dist-precheck
Fail a Python release before upload when PyPI would reject it.
Features
- Name check for first uploads: PyPI's own rules for a new project (valid name, not a stdlib module, not taken, not "too similar to an existing project"), run locally
- Free alternatives: a refused or taken name comes with up to five names that pass the same rules
- Archive checks: the wheel and sdist problems PyPI started rejecting on 18 Nov 2026 (ZIP data descriptors,
linux_x86_64tags, V7 and sparse tar members, and more) - CLI and GitHub Action: run it on your machine or as the step before
pypa/gh-action-pypi-publish - Zero dependencies: only the Python standard library, Python 3.9+
- Offline mode:
--no-name-checkruns the archive checks without network access
Why dist-precheck?
A 404 from pypi.org/simple/<name>/ does not mean PyPI will let you register the name. PyPI also refuses stdlib module names and any name that is "too similar to an existing project", and you only find out with a 400 at upload time. RedStar was free on the simple index and still got refused, because red-star exists.
The similarity rule is Warehouse's ultranormalize_name: drop ., _ and -, read l and i as 1 and o as 0, lowercase, then compare against every project on PyPI. dist-precheck downloads the PEP 691 simple index once a day (about 10 MB) and runs the same comparison locally.
twine check validates metadata only. PyPI has been tightening what it accepts in the archive itself (blog, 18 Nov 2026, docs.pypi.org/archives), and dist-precheck checks those rules too.
Checked against 25 names PyPI really refused in Oct to Dec 2026 (25 of 25 flagged) and the 40 newest accepted projects on 5 Dec 2026 (0 flagged). See tests/validate_real.py.
Installation
pip install dist-precheck
Or run it without installing:
pipx run dist-precheck --help
Usage Examples
Check a name before you build
dist-precheck name RedStar puremath json dist-precheck
TOO_SIMILAR PyPI will refuse 'RedStar' as too similar to existing 'red-star' (same name once . _ - are dropped, l/i read as 1 and o as 0). Pick another name, or ask in pypi/support for a name-similarity review
free alternatives (same rules): redstar-py, redstar-kit, redstar-tool, redstar-lib, redstar-sdk
TOO_SIMILAR PyPI will refuse 'puremath' as too similar to existing 'pure-math' (same name once . _ - are dropped, l/i read as 1 and o as 0). Pick another name, or ask in pypi/support for a name-similarity review
free alternatives (same rules): puremath-py, puremath-kit, puremath-tool, puremath-lib, puremath-sdk
STDLIB 'json' matches a Python standard-library module; PyPI refuses it
free alternatives (same rules): json-sdk, json-core, json-dev, json-hq
FREE 'dist-precheck' is free and passes PyPI's public name rules (admin-prohibited names can't be checked)
The exit code is 1 when any name would be refused. Add --no-suggest to skip the alternatives.
Check built distributions
python -m build
dist-precheck dist/*
OK dist_precheck-1.0.0-py3-none-any.whl
OK dist_precheck-1.0.0.tar.gz
NAME dist-precheck: FREE 'dist-precheck' is free and passes PyPI's public name rules (admin-prohibited names can't be checked)
Each file gets OK or FAIL with its problems listed. The name check runs only when the project is not on PyPI yet. Add --no-name-check to skip it and stay offline.
Use as a GitHub Action
Add the action between the build step and the publish step:
jobs:
release:
runs-on: ubuntu-latest
environment: pypi
permissions:
id-token: write
steps:
- uses: actions/checkout@v5
- uses: actions/setup-python@v6
with:
python-version: "3.13"
- run: python -m pip install build && python -m build
- uses: ysskrishna/dist-precheck@v1
- uses: pypa/gh-action-pypi-publish@release/v1
The step fails, and the upload never runs, when PyPI would reject a file or the name.
| Input | Default | Description |
|---|---|---|
path |
dist |
Directory with the built .whl and .tar.gz files |
name-check |
true |
On a first upload, check the project name against PyPI's rules. Set false on runners without network access |
The action runs with the runner's python3 (3.9 or newer) and installs nothing.
What it checks
| Check | Level |
|---|---|
| First upload: invalid name, stdlib module name, taken, too similar to an existing project | ERROR |
ZIP data descriptors (400 ... ZIP contains a data descriptor) |
ERROR |
| Trailing or prepended bytes, member comments, duplicate entries, non-UTF-8 or control-character names, central-directory gaps | ERROR |
linux_x86_64-style platform tags (400 ... unsupported platform tag) |
ERROR |
V7 tar headers, GNU and pax sparse members, pax vendor extensions (SCHILY.*, LIBARCHIVE.*) |
ERROR |
| Archive-level ZIP comment, GNU-format tarball | WARN (PyPI says it will reject these next) |
If the project already exists on PyPI, the name check is skipped: dist-precheck cannot tell whether you own it, and an upload to someone else's project fails with 403 anyway. Admin-prohibited names are not public, so they cannot be checked. That includes some deleted names.
CLI Reference
| Command | Description |
|---|---|
dist-precheck <files>... |
Check wheels and sdists, then the project name on a first upload. Exit 1 on any ERROR. |
dist-precheck <files>... --no-name-check |
Archive checks only. No network access. |
dist-precheck name <project>... |
Check one or more names against PyPI's rules. Exit 1 if any would be refused. |
dist-precheck name <project>... --no-suggest |
Same, without free alternatives. |
dist-precheck --help / --version |
Print usage or the version. |
The simple index is cached for a day in $XDG_CACHE_HOME/dist-precheck (default ~/.cache/dist-precheck).
Learn More
- PyPI blog: Stricter checks for uploaded distributions (18 Nov 2026)
- PyPI docs: archive requirements
- Warehouse project name checks
- PEP 691: JSON-based Simple API
Acknowledgments
- stdlib-list (MIT), the source of the stdlib name list, the same one Warehouse uses
- Warehouse, for the name rules this tool mirrors
Contributing
We welcome contributions! Please see our Contributing Guide for details.
Built and maintained by
dist-precheck is built and maintained by:
| Name | GitHub | Role | |
|---|---|---|---|
| Y. Siva Sai Krishna | @ysskrishna | Creator |
Changelog
See CHANGELOG for release history.
Support
If you find this tool helpful:
- ⭐ Star the repository
- 🐛 Report issues
- 🔀 Submit pull requests
- 💝 Sponsor on GitHub
License
MIT © Y. Siva Sai Krishna - see LICENSE for details.
Author's GitHub • Author's LinkedIn • Author's site • Package on PyPI • Report Issues
Metadata
Release files for dist-precheck 1.0.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| dist_precheck-1.0.0.tar.gz | 42.3 kB | With provenance | Details for dist_precheck-1.0.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| dist_precheck-1.0.0-py3-none-any.whl | Python 3 | none | any | Details for dist_precheck-1.0.0-py3-none-any.whl |
Total release size: 65.4 kB
Release files / dist_precheck-1.0.0.tar.gz
| Download URL | dist_precheck-1.0.0.tar.gz |
|---|---|
| Size | 42.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
e270b4e0bae3d791403908231aecbe41e6be6226d6efda7d158dcf18351288a6
|
|
BLAKE2b-256 checksum How to use checksums |
91af69b78941b3272c1666b82c6155f072c04db484f0f4854505562e49eeddfb
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.13.13 {"installer":{"name":"uv","version":"0.13.13","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Dec 5, 2026.
Transparency logRelease files / dist_precheck-1.0.0-py3-none-any.whl
| Download URL | dist_precheck-1.0.0-py3-none-any.whl |
|---|---|
| Size | 23.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
78953f8cf19a8df77e060ad04e2692f2bd6d505a59929b1a71fc207c99c54c6f
|
|
BLAKE2b-256 checksum How to use checksums |
422bcc27713ec95dc503899b5d5af38ec7a779061dc4f6703911da84de9f2d64
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.13.13 {"installer":{"name":"uv","version":"0.13.13","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Dec 5, 2026.
Transparency logSecurity for dist-precheck 1.0.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
Both files in this release have been uploaded with provenance metadata.
Attestation for dist_precheck-1.0.0.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Dec 5, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.