Python Build Tools Cheat Sheet
|
This content was generated with the assistance of AI and should be verified against the official documentation before being relied on in production. The reference material consulted while preparing these pages is listed in the Python Reference bibliography. |
A single-page, colour-coded summary of the build automation section, written against pip 26.2.2, Poetry 2.5.1 (poetry-core
2.5.0), build 1.6.1 and twine 7.0.0, and checked on 2026-10-22. It opens with what pip and Poetry share: the five roles (frontend,
backend, installer, index, environment), sdists and wheels, the pyproject.toml tables, specifier operators and markers, how
Poetry’s ^ and ~ constraints translate to PEP 440, and the lock-file options. A table then maps pip and Poetry side by side
(installing a project, adding, removing and upgrading a dependency, locking, installing from the lock, syncing, the dependency
tree, building, publishing, indexes, credentials, groups, running in the environment). The pip block lists the install options
used most, requirements-file syntax, constraints and build constraints, --group, hash-checking mode, --report and
pip lock, configuration files and their precedence with PIP_*, and the error references. The Poetry block lists the
commands by task, --with, --without and --only, install versus update versus sync, source priorities, the settings that
matter with their POETRY_* form, and plugins. The publishing block has the release checklist, the build, check and upload
commands for both chains, a .pypirc skeleton, a Trusted Publishing job, yanking and the wheel-filename anatomy, and a
"then → now" strip lists what replaced what — handy for quick memorization or as a
downloadable PDF desk reference.
For the full explanation, every option, and additional examples, see the dedicated pages:
Start here — Build Automation Tools (pip & Poetry).
Shared foundations — Packaging Concepts & Standards, pyproject.toml, Versions & Dependency Specifiers, Environments & Externally Managed Pythons, Lock Files & Reproducible Installs, Supply-Chain Security, CI Caching & Containers, Choosing & Migrating, and Ecosystem.
pip: Getting started — pip, Versions & Release History, Installing & Upgrading pip, and Running pip & General Options.
pip: Installing and describing requirements — Installing Packages, Managing Installed Packages, Requirements Files, Constraints & Build Constraints, and Dependency Groups & Inline Script Metadata.
pip: Resolution, sources and builds — Dependency Resolution, Package Indexes & Finding Packages, VCS, Direct URL & Local Project Installs, Build System Interface, and Wheels & Caching.
pip: Configuration, reproducibility and troubleshooting — Configuration, Authentication, Proxies & Certificates, Repeatable & Secure Installs, pip lock & pylock.toml, and Troubleshooting.
Poetry: Getting started — Poetry, Versions & Release History, Installation & Self-Management, Basic Usage & Project Setup, and pyproject.toml & Project Metadata.
Poetry: Dependencies — Dependency Specification, Managing Dependencies & Groups, and Lock File: install, update & sync.
Poetry: Environments, configuration and sources — Managing Environments, Configuration, and Repositories & Package Sources.
Poetry: Commands, plugins, integrations and upkeep — Commands Reference, Plugins, Exporting Requirements & Bundling, tox, nox, pre-commit & Docker, Migrating to Poetry 2, and Troubleshooting & FAQ.
Publishing: Preparing, building and checking — Publishing & Distributing Libraries, Preparing a Library, Build Backends, Versioning & Release Management, Building sdists & Wheels, Binary Wheels & Extension Modules, and Checking & Testing Distributions.
Publishing: Uploading and after — PyPI & TestPyPI Accounts & Tokens, Publishing with build & twine, Publishing with Poetry, Trusted Publishing & Attestations, GitHub Actions & GitLab CI Release Workflows, Managing Published Releases, Private Indexes & Alternative Distribution, and Distributing Applications & CLI Tools.