Twine
What it is
Twine is a free tool for publishing Python packages to PyPI and other configured repositories, including TestPyPI and private registries. It uploads source and binary distribution files that have already been built, so the upload step does not require it to run setup.py. This lets developers check distributions before release. Twine accepts packaging formats including wheels, and its check command checks whether a distribution’s long description will render correctly on PyPI. It authenticates to PyPI over a verified HTTPS connection. Users can sign files with GPG or upload files signed in advance. Repository settings can come from a .pypirc file, command-line options, or environment variables, the latter useful on CI and build servers. Twine can store credentials with keyring, though headless Linux systems may need extra setup for secure secret storage. It supports macOS, Windows, and Linux, requires Python 3.10 or later, and is licensed under Apache-2.0.
For and against
For
- Free to use under Apache-2.0.
- Uploads source and binary distributions independently of builds.
- Supports wheels and other packaging formats.
- Authenticates to PyPI over verified HTTPS.
- Can sign uploads with GPG.
Against
- Requires Python 3.10 or later.
- Headless Linux may need extra keyring setup.
- Does not provide lockfile support.
- Does not provide environment management or dependency groups.
The verdict
Twine focuses on package distribution, with repository options and checks for release artifacts. Developers should account for its Python version requirement and the extra keyring setup that may be needed on headless Linux.
Who it suits
Twine suits developers who need to upload built Python distributions to public or private package repositories. It can also fit CI workflows that use environment variables for repository settings.
Plans and prices
Twine
Apache-2.0 · Python >=3.10
Read 8 Oct 2026 · pypi.org
On the record
- Automation
- The documentation notes that environment-variable configuration can be useful on CI or build servers.twine.readthedocs.io · read 7 Oct 2026
- Build independence
- Twine uploads already-built distribution files without requiring it to run setup.py.twine.readthedocs.io · read 7 Oct 2026
- Build workflow
- Twine uploads files that have already been created, so distributions can be tested before release without executing setup.py during upload.twine.readthedocs.io · read 8 Oct 2026
- Configuration
- Repository settings can be supplied through a .pypirc file, command-line options, or environment variables.twine.readthedocs.io · read 8 Oct 2026
- Credential storage
- Twine supports storing repository usernames and passwords securely using keyring.twine.readthedocs.io · read 8 Oct 2026
- Distribution checks
- The twine check command checks whether a distribution’s long description will render correctly on PyPI.twine.readthedocs.io · read 7 Oct 2026
- File signing
- Twine supports signing uploads with GPG and can upload pre-signed .asc files.twine.readthedocs.io · read 8 Oct 2026
- Intended users
- PyPI classifies Twine’s intended audience as developers.pypi.org · read 8 Oct 2026
- Keyring limitation
- The documentation says keyring may require additional setup on some systems, especially Linux headless environments.twine.readthedocs.io · read 8 Oct 2026
- License
- The package is licensed under Apache-2.0.pypi.org · read 8 Oct 2026
- Package checks
- The twine check command checks whether a distribution’s long description will render correctly on PyPI.twine.readthedocs.io · read 8 Oct 2026
- Package formats
- Twine supports any packaging format, including wheels.twine.readthedocs.io · read 7 Oct 2026
- Package uploads
- It uploads source and binary distribution files independently of the build system.twine.readthedocs.io · read 8 Oct 2026
- Purpose
- Twine is a utility for publishing Python packages to PyPI and other repositories.twine.readthedocs.io · read 8 Oct 2026
- Repositories
- Twine documentation shows uploading to PyPI, Test PyPI, and other package indexes configured by repository name or URL.twine.readthedocs.io · read 8 Oct 2026
- Runtime requirement
- The package requires Python 3.10 or later.pypi.org · read 8 Oct 2026
- Secure connection
- Twine authenticates to PyPI over HTTPS using a verified connection.twine.readthedocs.io · read 8 Oct 2026
- Security
- The documentation says Twine authenticates to PyPI over HTTPS using a verified connection.twine.readthedocs.io · read 7 Oct 2026