The PyPI Release Checklist
PyPI does not let you reuse a filename once it has been uploaded, even if you delete the release. That makes every upload effectively permanent, and a broken wheel means burning a version number. This checklist is ordered the way a release actually flows: metadata, build, inspect, rehearse, publish.
1. Metadata
- [ ] The version follows PEP 440. Strings such as
1.0.0-betanormalise to1.0.0b0, which may not be what you meant; write the normalised form yourself. - [ ]
requires-pythonreflects what you test. Installers use it to pick an older release for older interpreters, so a wrong value strands users. - [ ] Dependencies use ranges, not exact pins. A library that pins
==makes itself impossible to install alongside others. - [ ] Licence metadata is present. Use an SPDX expression where your build backend supports PEP 639, or the classifier otherwise.
- [ ]
readmepoints at a file PyPI can render. A broken long description is the first thing visitors see. - [ ] Project URLs include the source and the changelog. They appear in the PyPI sidebar and save users a search.
[project]
name = "package-a"
version = "2.1.0"
requires-python = ">=3.9"
readme = "README.md"
license = "MIT"
dependencies = ["httpx>=0.25,<1"]
[project.urls]
Source = "https://example.invalid/package-a"
Changelog = "https://example.invalid/package-a/blob/main/CHANGELOG.md"
(The URLs above are placeholders; use your real repository.)
2. Build
- [ ] Build in a clean environment with
python -m build. Isolated builds catch undeclared build-time requirements. - [ ] Both an sdist and a wheel are produced. Some users and downstream packagers build from the sdist.
- [ ] Wheel tags are what you expect. A pure-Python wheel should be
py3-none-any; anything else means a platform-specific build slipped in.
3. Inspect
- [ ] List the wheel's contents (
python -m zipfile -l dist/*.whl). Missing package data and stray test folders show up here. - [ ] Run
twine check dist/*. It validates that the metadata and README will render. - [ ] Install the wheel into a fresh virtual environment and import it. This catches the src-layout mistake where tests passed against the source tree, not the package.
4. Rehearse
- [ ] Upload to TestPyPI first for new projects or new workflows. It is a separate instance meant for exactly this, so mistakes do not burn real version numbers.
- [ ] Install from TestPyPI using an extra index only for your package. Dependencies should still come from the real index.
5. Publish
- [ ] Publish from CI with Trusted Publishing. The workflow gets a short-lived token, so no API token needs storing.
- [ ] The git tag matches the version in the uploaded files. A mismatch confuses everyone triaging later bug reports.
- [ ] If a release is broken, yank it rather than deleting it. Yanked versions stay installable when pinned exactly but are skipped by range resolution (PEP 592).
The Python Packaging User Guide is the authoritative source for each step. On this site, see the Trusted Publishing setup, the requires-python mistake case study and the src layout guide.