Packaging and Distribution
- pyproject.toml. Modern packaging centres on pyproject.toml: one file naming the project, version, dependencies and build system.
- Wheels. A wheel is the built, installable artifact pip actually installs: building one is the release step.
- Entry points. An entry point maps a command name to a function, turning your package into an installable CLI tool.
Configuration, Logging and Environments
- Config from the environment. Twelve-factor services read configuration from environment variables: code stays identical across dev and prod.
- The logging module. The logging module separates what is logged from where it goes: handlers and levels decide at deploy time.
- Secrets. Secrets never live in code or git: they arrive through the environment or a secret manager at runtime.
Production-Grade Python Design
- Health and readiness. A production service exposes a health endpoint so orchestrators know when to route and when to restart.
- Graceful shutdown. Handle the termination signal: stop taking work, finish what is in flight, then exit clean.
- Boring dependencies. Production Python favours boring choices: mature libraries, pinned versions, and one obvious way per problem.
Before and after this level
- Before: Level 15: Performance: Profiling Python, Memory and CPU Optimisation, Native Extensions and Performance Boundaries.
- Next: Level 17: Python Mastery: Advanced Language Patterns, Architecture and Maintainability, Reading and Improving Complex Python Systems.
In the app each of these ideas is taught and then asked back, and the level ends with a checkpoint and flashcards. See Checkpoints and flashcards.
Frequently asked questions
What does Python Level 16: Packaging & Production Python cover?
Packaging and Distribution, Configuration, Logging and Environments, Production-Grade Python Design: 3 lessons and 9 ideas.
What should I know before this level?
The level before it, Level 15: Performance, which covers Profiling Python, Memory and CPU Optimisation, Native Extensions and Performance Boundaries.