Skip to content
Latchkey

twine check: Validate Distributions Command Reference

Catch broken package metadata before you publish.

twine check validates the metadata and long-description rendering of built distributions. Running it before twine upload prevents a publish from failing or rendering badly on PyPI.

Common flags / usage

  • twine check dist/* -- validate every artifact in dist/
  • --strict -- treat rendering warnings as errors
  • run after python -m build, before twine upload

Example

shell
- run: python -m build
- run: python -m twine check --strict dist/*

In CI

Add twine check --strict as a fast gate after the build step. It flags an unrenderable README or missing metadata so the failure surfaces in seconds rather than on a rejected upload.

Key takeaways

  • twine check validates distribution metadata and README rendering.
  • --strict turns rendering warnings into failures.
  • Run it after build and before upload as a cheap publish gate.

Related guides

Tired of flaky CI? Latchkey auto-heals failed jobs and retries them for you. Start free →