Use Poetry dependency groups to keep pytest, black, and mypy out of production while one committed lock file keeps every environment reproducible. Covers group syntax, install flags, and verification.
Poetry's dependency groups (1.2.0+) let you split runtime, test, lint, and optional dependencies into named sets and install only what each CI stage or environment needs — smaller images, faster pipelines.
Poetry 1.2+ dependency groups keep dev tooling out of published wheels, while extras remain the only way to let downstream users select optional features via pip. Use both: groups for test/lint/docs, extras for public feature flags like [redis] or [async].
Poetry’s lock file records exact versions and hashes, uses a backtracking resolver to handle conflicts, and gates optional dependencies so reproducible builds are achievable across platforms—if you verify on each target OS.
Learn how to eliminate long-lived secrets in PyPI deployments using Trusted Publishing. This guide covers the OIDC architecture, trust boundaries, and configuration for token-less uploads.
Learn how to choose between Source Distributions (sdist) and Binary Wheels for PyPI. This guide compares installation speed, compatibility, and the manylinux standard to help you implement a hybrid publishing strategy.
Decide where each non-core dependency lives in a Poetry project: groups for internal tooling, extras for user-facing optional features, markers for platform conditions — with a concrete pyproject.toml layout, install commands per environment, and validation steps.