python
Context skill for Python projects managed with uv, covering workspaces, ML tracking, distributed compute, GPU kernels, and service architecture.
Requirements
uv— Python package and project manager (curl -LsSf https://astral.sh/uv/install.sh | sh)
Philosophy
uv is the only package manager — pip and bare python invocations are never used; all commands go through uv run. Every project commits pyproject.toml, uv.lock, and .python-version together, and multi-package workspaces share a single uv.lock. All packages use a src/<package>/ layout. Heavy or optional imports (GPU backends, Ray, Warp) are deferred to function bodies to avoid breaking hosts that lack those backends. Domain types crossing JSON or IPC boundaries use Pydantic v2 BaseModel; internal argument bundles use @dataclass.
Recipes
- Python Project Setup with uv — standalone packages, workspaces, ruff, commitizen
- Python Project Conventions and Architecture — src/ layout, deferred imports, Protocols, typing, testing discipline
- Publishing Python Packages with uv — PyPI, GitLab, and GCP Artifact Registry
- Experiment Tracking with MLflow — runs, metrics, model registry, Ray integration
- Distributed Computing with Ray — tasks, actors, three-executor pattern, AWS cluster
- GPU Kernels with Nvidia Warp — deferred imports, kernel patterns, slabbed VRAM, backend selector
- Data Validation with Pydantic — BaseModel, frozen models, PrivateAttr, dataclasses
- CLI Commands with Click — groups, ctx.obj, lazy services, error handling