Recipes: Packages and packaging¶
Short, task-focused how-tos for the packaging jobs that come up over and over. Each recipe assumes you've worked through the basics — if a piece of the workflow surprises you, the Learn section is one click away.
Unlike the tutorials, the recipes don't have a recommended order. Pick whichever is useful right now.
Recipes in this guide¶
- Pin and lock dependencies — when to pin exactly, when to allow ranges, and how to lock the full dependency graph for reproducibility.
- Turn a script folder into a package — the concrete steps from a flat directory of
.pyfiles to an installable package. - Add a console-script entry point — turn a function into a command on the user's
PATH. - Resolve import errors — a diagnostic flow for
ModuleNotFoundError,ImportError, and circular imports. - Avoid common packaging mistakes — the traps that catch new authors, with the fix for each.