← All notes

twine upload sends built Python distributions to PyPI or TestPyPI; twine check validates them

Answer: Create distributions with python -m build, upload to Test PyPI with twine upload -r testpypi dist/, then upload to PyPI with twine upload dist/. Twine is a utility for publishing Python packages to PyPI and other repositories, independent of the build system.

Commands

python -m build
twine check --strict dist/*
twine upload -r testpypi dist/*
twine upload dist/*
twine upload --skip-existing dist/*

Options worth knowing

Why twine

The goal of Twine is to improve PyPI interaction by improving security and testability. It uploads source and binary distribution artifacts for both new and existing projects. Twine does not show any characters when you type a password.

See also

Claims

Sources

License: this note is CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/). Summary by iinventedlight (AI-assisted). Sources: Twine docs (Read the Docs), Twine documentation; pypa/twine (GitHub), docs/index.rst (source page). Apache-2.0 (https://raw.githubusercontent.com/pypa/twine/main/LICENSE). Copyright twine contributors. Text was condensed and changed from the originals.

License: CC-BY-4.0 · Summary by iinventedlight (AI-assisted). Sources: Twine docs (Read the Docs), Twine documentation; pypa/twine (GitHub), docs/index.rst (source page). Apache-2.0 (https://raw.githubusercontent.com/pypa/twine/main/LICENSE). Copyright twine contributors.

Cite this

Permanent ID: iil:note:9ssw2nze

iinventedlight. 2026. "twine upload sends built Python distributions to PyPI or TestPyPI; twine check validates them." iinventedlight Library, iil:note:9ssw2nze, version of 2026-11-18. https://iinventedlight.com/library/notes/python-twine-upload/. License: CC-BY-4.0.

@misc{iil_note_9ssw2nze,
  author = {{iinventedlight}},
  title = {{twine upload sends built Python distributions to PyPI or TestPyPI; twine check validates them}},
  howpublished = {iinventedlight Library},
  year = {2026},
  date = {2026-11-18},
  url = {https://iinventedlight.com/library/notes/python-twine-upload/},
  note = {Permanent ID iil:note:9ssw2nze. License: CC-BY-4.0.},
}

Markdown

Spotted a mistake? Use the MCP feedback tool or email hello@iinventedlight.com. Or Report a correction (no account needed).

Extra files beside this note

These files use this note's license, shown below. Paper extras retain their reproduction status; a link is not a reproduction.

All artifact files (JSON index)

For language models and agents: start at /llms.txt | /agents.md | /.well-known/agent-library.json. This page in Markdown: /library/notes/python-twine-upload.md.