twine(1)
πΈ twine β the manual page, but make it cute πΈ
okay bestie, so this is twine(1), from the General Commands Manual section. yeah. section 1. command line stuff. we love her π
β¨ NAME β¨
twine β the client that does uploads on pypi. that's it. that's the whole job π«Ά
π DESCRIPTION π
this command is like, the standard way people upload python modules to pypi.org or any other repo that plays nice with it. iconic behaviour honestly π
π NOTES ON PYPI.ORG π
so twine can talk to a bunch of different repositories, right? but the default? pypi.org. and because that's basically everybody's use case, this whole section exists to document all the quirky little things about pypi.org that aren't documented anywhere else. iykyk π
π₯ Upload via token
username and password uploads are literally no longer supported on pypi.org. gone. dead. not a thing anymore. π
so if you wanna upload and authenticate with a token, the command looks like this:
twine upload --username __token__ --password `cat .token` dist/
that's the vibe. that's the move. β¨
π― Scope limited token
you can grab tokens from the pypi.org website, obviously.
but here's the tea β: if you wanna make a token that's limited to a project that doesn't exist yet, you literally cannot do it directly. you have to:
- create a global token first
- use that global token to do the very first upload of the project
- then delete that global token from the website
and only then can you generate a token that's scoped to that project. the way that works is so extra but okay π
ποΈ Signing
signing is not allowed on pypi.org. periodt.
if you upload something that's signed, pypi.org greets you with a warning email π¬ β and the signature files get dropped. not even kept. just gone.
and in the future? they might make the upload straight up fail. so like, heads up fr fr π¨
β SYNOPSIS β
twine [-h] [--version] [--no-color] [<command>] [args]
β¨ Options:
-h,--helpβ show the help message and exit. classic. π«Ά-v,--versionβ show the version and exit. tell me who you are bestie π--no-colorβ disable coloured output. for when you want your terminal to be boring. (valid. i respect it.) π
π¦ Commands:
πΈ check
usage:
twine check [-h] [--strict] dist [dist ...]
positional arguments:
distβ The distribution files to check, usuallydist/*
options:
-h,--helpβ show this help message and exit--strictβ Fail on warnings
π register
usage:
twine register [-h] [-r REPOSITORY] [--repository-url REPOSITORY_URL] [--attestations] [-s] [--sign-with SIGN_WITH] [-i IDENTITY] [-u USERNAME] [-p PASSWORD] [--non-interactive] [-c COMMENT] [--config-file CONFIG_FILE] [--skip-existing] [--cert path] [--client-cert path] [--verbose] [--disable-progress-bar] package
register operation is not required with PyPI.org
just so you know. you don't need it over there. π
positional arguments:
packageβ File from which we read the package metadata.
options:
-h,--helpβ show this help message and exit-r REPOSITORY,--repository REPOSITORYβ The repository (package index) to upload the package to. Should be a section in the config file (default:pypi). (Can also be set viaTWINE_REPOSITORYenvironment variable.)--repository-url REPOSITORY_URLβ The repository (package index) URL to upload the package to. This overrides--repository. (Can also be set viaTWINE_REPOSITORY_URLenvironment variable.)--attestationsβ Upload each file's associated attestations.-s,--signβ Sign files to upload using GPG.--sign-with SIGN_WITHβ GPG program used to sign uploads (default:gpg).-i IDENTITY,--identity IDENTITYβ GPG identity used to sign files.-u USERNAME,--username USERNAMEβ The username to authenticate to the repository (package index) as. (Can also be set viaTWINE_USERNAMEenvironment variable.)-p PASSWORD,--password PASSWORDβ The password to authenticate to the repository (package index) with. (Can also be set viaTWINE_PASSWORDenvironment variable.)--non-interactiveβ Do not interactively prompt for username/password if the required credentials are missing. (Can also be set viaTWINE_NON_INTERACTIVEenvironment variable.)-c COMMENT,--comment COMMENTβ The comment to include with the distribution file.--config-file CONFIG_FILEβ The.pypircconfig file to use.--skip-existingβ Continue uploading files if one already exists. (Only valid when uploading to PyPI. Other implementations may not support this.)--cert pathβ Path to alternate CA bundle (can also be set viaTWINE_CERTenvironment variable).--client-cert pathβ Path to SSL client certificate, a single file containing the private key and the certificate in PEM format.--verboseβ Show verbose output.--disable-progress-barβ Disable the progress bar.
π upload
usage:
twine upload [-h] [-r REPOSITORY] [--repository-url REPOSITORY_URL] [--attestations] [-s] [--sign-with SIGN_WITH] [-i IDENTITY] [-u USERNAME] [-p PASSWORD] [--non-interactive] [-c COMMENT] [--config-file CONFIG_FILE] [--skip-existing] [--cert path] [--client-cert path] [--verbose] [--disable-progress-bar] dist [dist ...]
positional arguments:
distβ The distribution files to upload to the repository (package index). Usuallydist/*. May additionally contain a.ascfile to include an existing signature with the file upload.
options:
-h,--helpβ show this help message and exit-r REPOSITORY,--repository REPOSITORYβ The repository (package index) to upload the package to. Should be a section in the config file (default:pypi). (Can also be set viaTWINE_REPOSITORYenvironment variable.)--repository-url REPOSITORY_URLβ The repository (package index) URL to upload the package to. This overrides--repository. (Can also be set viaTWINE_REPOSITORY_URLenvironment variable.)--attestationsβ Upload each file's associated attestations.-s,--signβ Sign files to upload using GPG.--sign-with SIGN_WITHβ GPG program used to sign uploads (default:gpg).-i IDENTITY,--identity IDENTITYβ GPG identity used to sign files.-u USERNAME,--username USERNAMEβ The username to authenticate to the repository (package index) as. (Can also be set viaTWINE_USERNAMEenvironment variable.)-p PASSWORD,--password PASSWORDβ The password to authenticate to the repository (package index) with. (Can also be set viaTWINE_PASSWORDenvironment variable.)--non-interactiveβ Do not interactively prompt for username/password if the required credentials are missing. (Can also be set viaTWINE_NON_INTERACTIVEenvironment variable.)-c COMMENT,--comment COMMENTβ The comment to include with the distribution file.--config-file CONFIG_FILEβ The.pypircconfig file to use.--skip-existingβ Continue uploading files if one already exists. (Only valid when uploading to PyPI. Other implementations may not support this.)--cert pathβ Path to alternate CA bundle (can also be set viaTWINE_CERTenvironment variable).--client-cert pathβ Path to SSL client certificate, a single file containing the private key and the certificate in PEM format.--verboseβ Show verbose output.--disable-progress-barβ Disable the progress bar.
π± ENVIRONMENT π±
all of these can be used instead of the command line options. so if you're the kind of person who sets env vars and forgets, this is for you bestie π
TWINE_USERNAMETWINE_PASSWORDTWINE_REPOSITORY_URLTWINE_REPOSITORYTWINE_CERTTWINE_NON_INTERACTIVE
π SEE ALSO π
(yeah. section 3. don't ask. just go look. π¦)
π AUTHOR π
this manual page was written for Debian by Salvo 'LtWorf' Tomaselli <ltworf@debian.org> β but it may freely be used by others. so generous. we love that for us π«Άβ¨
and that's the whole page bestie!! no cap, you now know everything this manpage knows π
twine β "Client to upload on pypi" β dated Sep 13, 2024 β page twine(1), and she ate, periodt ππ
π¦ where this page comes from
- debian trixie: twine 6.1.0-1 Β· Apache-2.0
- ubuntu questing: twine 6.1.0-1
- ubuntu resolute: twine 6.2.0-3 Β· Apache-2.0
- ubuntu stonking: twine 6.2.0-6 Β· Apache-2.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms