LinuxCommandLibrary

twine

TLDR

Upload package to PyPI

$ twine upload dist/*
copy
Upload to TestPyPI
$ twine upload --repository testpypi dist/*
copy
Upload with credentials
$ twine upload -u [username] -p [password] dist/*
copy
Check package before upload
$ twine check dist/*
copy
Upload specific files
$ twine upload [dist/package-1.0.tar.gz]
copy
Upload with verbose output
$ twine upload --verbose dist/*
copy

SYNOPSIS

twine [upload] [check] [-r repository] [-u user] [options] files

DESCRIPTION

twine uploads Python packages to PyPI and other package indexes. It's the recommended tool for publishing Python packages.
Package files (.tar.gz and .whl) in the dist directory are uploaded. These are created by build tools like build or setuptools.
Check mode validates package metadata before upload. It catches common issues that would cause upload failure.
TestPyPI allows testing the upload process without affecting the real PyPI. Packages can be installed from TestPyPI to verify.
Authentication uses username/password, API tokens, or keyring integration. API tokens are recommended for security.
HTTPS is always used for uploads. Previous tools allowed insecure uploads, which twine explicitly prevents.

PARAMETERS

upload FILES

Upload packages.
check FILES
Check package metadata.
-r REPO, --repository REPO
Target repository (pypi, testpypi, or URL).
--repository-url URL
Repository URL.
-u USER, --username USER
Username.
-p PASS, --password PASS
Password.
--non-interactive
Don't prompt for credentials.
-s, --sign
Sign files with GPG.
-c FILE, --config-file FILE
Config file.
--skip-existing
Skip already-uploaded files.
--verbose
Verbose output.

CAVEATS

Package names are permanent on PyPI. Version numbers can't be reused. Credentials need secure handling. Package must pass validation.

HISTORY

Twine was created by the Python Packaging Authority around 2013 to replace the insecure upload mechanism in setuptools. It ensures all uploads use HTTPS.

SEE ALSO

pip(1), build(1), setuptools(1), flit(1)

> TERMINAL_GEAR

Curated for the Linux community

New Raspberry Pi 3 Model B+ Board Raspberry PI 3B+

New Raspberry Pi 3 Model B+ Board Raspberry PI 3B+

$54.00
Bmax Mini PC B2 Power Intel 5205U 8GB DDR4 256GB M.2 NVMe SSD ,HDMI 1.4&DP 1.2, USB3.2,4K Dual Display 2.4G/5G WiFi & BT5.0 Mini Desktop Computers /Office/Design

Bmax Mini PC B2 Power Intel 5205U 8GB DDR4 256GB M.2 NVMe SSD ,HDMI 1.4&DP 1.2, USB3.2,4K Dual Display 2.4G/5G WiFi & BT5.0 Mini Desktop Computers /Office/Design

$169.99
BOSGAME Mini PC N95, Intel 12th Mini Computers| 16GB DDR4 RAM| 512GB M.2 2280 SSD| 4K 60HZ Triple Displays by Dual HDMI+Type-C, 6W TDP Quiet Mini PC, WIFI5, BT 5.0 Office

BOSGAME Mini PC N95, Intel 12th Mini Computers| 16GB DDR4 RAM| 512GB M.2 2280 SSD| 4K 60HZ Triple Displays by Dual HDMI+Type-C, 6W TDP Quiet Mini PC, WIFI5, BT 5.0 Office

$239.99
Copied to clipboard

> TERMINAL_GEAR

Curated for the Linux community

Lenovo Gen 13 ThinkPad X1 Carbon Touchscreen Laptop with Intel Ultra 7 265U Processor, 14" WUXGA 100% sRGB, 32GB DDR5 RAM, 1TB NVMe Performance SSD, FHD+ IR+ RGB Camera, and Windows 11 Pro

Lenovo Gen 13 ThinkPad X1 Carbon Touchscreen Laptop with Intel Ultra 7 265U Processor, 14" WUXGA 100% sRGB, 32GB DDR5 RAM, 1TB NVMe Performance SSD, FHD+ IR+ RGB Camera, and Windows 11 Pro

$1,589.00
Raspberry Pi 5 8GB

Raspberry Pi 5 8GB

$134.50
GMKtec Gaming PC, K11 AMD Ryzen 9 8945HS, 32GB DDR5 RAM 1TB Mini PC Desktop Computer, Oculink, Dual NIC 2.5GbE LAN, HDMI/DisplayPort/USB4*2

GMKtec Gaming PC, K11 AMD Ryzen 9 8945HS, 32GB DDR5 RAM 1TB Mini PC Desktop Computer, Oculink, Dual NIC 2.5GbE LAN, HDMI/DisplayPort/USB4*2

$739.99