Python Environments Pro Setup: In 4 Stunden Virtualenvs und Packaging meistern.
Hands-on mit venv, pip, pipx und poetry.
Reproduzierbare Umgebungen strukturieren und Dependencies effektiv verwalten.
Praktische Erfahrung sammeln durch Setup und Troubleshooting realer Projekte.
Nutzen: Zuverlässige Builds und reibungslose Zusammenarbeit sicherstellen.
Für wen: gedacht für Personen mit Python-Grundlagen, die professionelle Setup-Skills brauchen.
Mit optionalem Teil zu Advanced Packaging und Publishing Tools.
Curriculum
Professionelle Basis & Tooling
- Ziele: Isolation, Reproduzierbarkeit, Portabilität
- Python‑Installationen: System‑Python vs. pyenv vs. Anaconda (wann was)
- Projekt‑Skelett: src‑Layout, `.gitignore`, `.python-version`, `.env`, README‑Badges
- Pinning & Locking: `requirements.in`→`requirements.txt` (pip-tools) und `conda env export`
Windows — Anaconda/conda und pip
- Installation & Update von Anaconda/Miniconda; `conda init` für PowerShell
- Envs erstellen/aktivieren: `conda create -n app python=3.11`, `conda activate app`
- `conda` und `pip` sicher kombinieren; Channels; `conda-forge` Best Practices
- Alternative: pures `pip` + `python -m venv venv`; PowerShell Execution Policy
- Hands‑on: Env erstellen, einfrieren, exportieren, aus Lock neu aufsetzen
Linux — venv und virtualenvwrapper (`workon`)
- Benötigte Systempakete (`python3-venv`, Build‑Tools)
- Erstellen/aktivieren mit `python -m venv .venv`; `source .venv/bin/activate`
- virtualenvwrapper: Installation & Konfiguration; `mkvirtualenv`, `workon`, `setvirtualenvproject`
- Pip‑Index/Auth‑Basics; `pip config` für Mirrors/Zertifikate
- Hands‑on: `workon`‑Workflow und per‑Projekt `.venv` einrichten
macOS — Homebrew/conda und venv
- Installation via Homebrew: `brew install python` und optional `pyenv`
- Venv in zsh erstellen/aktivieren; typische PATH‑/SSL‑Fixes
- Conda auf macOS: Hinweise für Apple Silicon (arm64), `conda-forge`
- Hands‑on: ein Projekt mit venv, eins mit conda; sicheres Wechseln
Wheel bauen & veröffentlichen (pyproject.toml)
- `pyproject.toml` minimal mit `build-system` und Metadaten (PEP 621)
- Editierbare Installs: `pip install -e .` vs. Wheel‑Installs
- Build: `python -m build` → `dist/*.whl`
- Lokal installieren: `pip install dist/yourpkg-*.whl`
- Upload mit `twine` zu TestPyPI oder einem privaten Index (Nexus/Artifactory)
Optionale Module
Optional — CI & Team‑Workflow
- pre-commit Linters/Formatter (ruff/black) in sauberer Env
- Dependencies im CI cachen; `pip --require-hashes` vs. `conda-lock`
- Private Indexe: `--extra-index-url`, Tokens und Trust‑Einstellungen
Kursablauf
- Welcome + goals (micro): 09:00–09:10
- Part 1: 09:10–10:20
- Break: 10:20–10:30
- Part 2: 10:30–11:40
- Break: 11:40–11:50
- Part 3: 11:50–13:00