Generated by GPT-5-mini| PEP 440 | |
|---|---|
| Name | PEP 440 |
| Title | PEP 440 |
| Status | Final |
| Author | Donald Stufft |
| Type | Python Enhancement Proposal |
| Created | 2013 |
| Topic | Versioning |
PEP 440 PEP 440 defines a standardized versioning scheme for Python software packaging. It describes a syntax and normalization rules intended to coordinate tools such as pip, setuptools, and wheel across ecosystems including CPython, PyPI, and related projects. The document interacts with packaging infrastructure and cultural touchpoints in the Python community and the broader open source ecosystem.
PEP 440 specifies a lexical and semantic format for distribution version identifiers to ensure deterministic comparison and ordering of releases for tools like pip, setuptools, wheel, and virtualenv. It aligns with expectations from projects and organizations such as CPython, the Python Software Foundation, Debian, Fedora, and Canonical by providing normalization rules that packaging backends and registries can adopt. The specification affects package repositories including PyPI and mirror networks used by continuous integration services like Travis CI, CircleCI, and GitHub Actions.
The scheme allows numeric release segments, pre-releases, post-releases, developmental releases, local version identifiers, and epoch markers. Numeric segments map to conceptually similar schemes used by projects like Debian, Ubuntu, Red Hat, and Arch Linux while providing distinct semantics for pre-release markers used by organizations such as Mozilla, Apache Software Foundation, and Eclipse Foundation. The syntax supports separators and canonical forms analogous to those in projects like Node.js and Rust but remains tailored for Python packaging tools maintained by groups including the Python Packaging Authority and setuptools maintainers.
The specification defines formal tokens for epoch (! notation), release segments (dot-separated integers), pre-release identifiers (a, b, rc), post-release (.postN or -postN), development releases (.devN), and local version labels (+local). It prescribes normalization rules for case folding and punctuation comparable to normalization approaches used by Unicode and IETF standards bodies. The comparison algorithm orders epochs first, then release segments, then pre-releases, post-releases, development releases, and finally local parts, enabling deterministic selection behavior in dependency resolution engines developed by organizations like Google, Microsoft, and Amazon when integrating Python workflows. The PEP also enumerates edge cases for zero-padding, implicit zeros, and equivalence classes that match expectations followed by distribution maintainers at Red Hat, SUSE, and Gentoo.
The rationale traces to coordinated needs of CPython release managers, the Python Software Foundation, and third-party packagers to reduce ambiguous version comparisons that historically affected installers and dependency solvers. Early discussions involved contributors from projects and institutions such as Django Software Foundation, NumPy community, SciPy, and the Jupyter project, reflecting practical requirements from scientific computing initiatives at CERN and NASA. The evolution responded to problems observed in interoperability with systems from Debian packaging teams, Fedora Infrastructure, and cloud vendors like AWS and Google Cloud Platform serving Python workloads. The proposal built on conventions seen in broader software engineering practice exemplified by Semantic Versioning advocates and versioning practices at projects like PostgreSQL, LibreOffice, and KDE.
Examples illustrate canonical forms and comparisons: epochs align with legacy epoch usage in Debian packaging; pre-release markers map to conventions familiar to projects such as Django, Flask, and Pyramid; local versions enable build metadata similar in spirit to Git-based workflows used by projects hosted on GitHub, GitLab, and Bitbucket. Compatibility notes discuss interactions with packaging tools like pip, setuptools, wheel, build, and twine, and with registries like PyPI and internal artifact repositories used by enterprises including Netflix, Spotify, and Shopify. Migration stories reference community experiences from projects like pandas, scikit-learn, matplotlib, and TensorFlow when normalizing version identifiers to avoid solver regressions in continuous delivery pipelines run on Jenkins or GitHub Actions.
Adoption required updates to implementations in pip, setuptools, wheel, packaging, and related libraries maintained by the Python Packaging Authority, as well as updates to PyPI infrastructure overseen by the Python Software Foundation. Downstream packaging ecosystems such as Debian, Fedora, Arch Linux, and Homebrew adjusted tooling to handle canonicalized identifiers. Commercial cloud providers and research institutions integrated the rules into artifact publishing and CI/CD automation used by teams at Microsoft, Google, Amazon, Facebook, and academic groups at MIT and Stanford. The specification remains a reference point for compatibility work between packaging toolchains, dependency resolvers, and repository managers maintained by organizations across the open source landscape.