Python Packaging Pro
Modern Python packaging revolves around pyproject.toml. This skill ensures your projects are reproducible and ready for distribution.
The Modern Stack
- Build System: Use
poetryoruvfor dependency management. - Metadata: Configure everything in
pyproject.toml. - Environment: Use strictly pinned lock files (
poetry.lock).
Project Structure
project/
├── pyproject.toml
├── README.md
├── src/
│ └── project_name/
├── tests/
└── .github/workflows/ # CI/CD for testing and publishing
Best Practices
- Explicit Dependencies: Separate
mainanddevdependencies. - Type Checking: Include
mypyin your CI pipeline. - versioning: Follow Semantic Versioning (SemVer).