Clean up and organize the dependencies, optional dependencies, and dependency groups to follow a clear pattern:
-
dependencies - Core packages required at runtime (always installed)
- Use for: Essential functionality everyone needs
-
project.optional-dependencies - Optional feature groups users can choose
- Use for: Optional backends, integrations, heavy dependencies
- Install with:
pip install package[feature]
-
dependency-groups - Development workflow dependencies
- Use for: Testing, linting, docs (dev-only, not in package distribution)
- Install with:
uv sync --group test
- Key benefit: Cleaner separation, not included in published package metadata
Decision Guide
- Runtime required →
dependencies
- Optional user feature →
project.optional-dependencies
- Development only →
dependency-groups
The key insight: dependency-groups is the modern standard for development dependencies that shouldn't be part of your package's public API, while optional-dependencies is for user-facing optional features.
Clean up and organize the dependencies, optional dependencies, and dependency groups to follow a clear pattern:
dependencies- Core packages required at runtime (always installed)project.optional-dependencies- Optional feature groups users can choosepip install package[feature]dependency-groups- Development workflow dependenciesuv sync --group testDecision Guide
dependenciesproject.optional-dependenciesdependency-groupsThe key insight:
dependency-groupsis the modern standard for development dependencies that shouldn't be part of your package's public API, whileoptional-dependenciesis for user-facing optional features.