.\" Man page generated from reStructuredText. . . .nr rst2man-indent-level 0 . .de1 rstReportMargin \\$1 \\n[an-margin] level \\n[rst2man-indent-level] level margin: \\n[rst2man-indent\\n[rst2man-indent-level]] - \\n[rst2man-indent0] \\n[rst2man-indent1] \\n[rst2man-indent2] .. .de1 INDENT .\" .rstReportMargin pre: . RS \\$1 . nr rst2man-indent\\n[rst2man-indent-level] \\n[an-margin] . nr rst2man-indent-level +1 .\" .rstReportMargin post: .. .de UNINDENT . RE .\" indent \\n[an-margin] .\" old: \\n[rst2man-indent\\n[rst2man-indent-level]] .nr rst2man-indent-level -1 .\" new: \\n[rst2man-indent\\n[rst2man-indent-level]] .in \\n[rst2man-indent\\n[rst2man-indent-level]]u .. .TH "TWINE" "1" "Apr 24, 2024" "5.0" "twine" .SH NAME twine \- twine Documentation .sp This project follows the \fI\%semantic versioning\fP and \fI\%pre\-release versioning\fP schemes recommended by the Python Packaging Authority. .SH TWINE 5.0.0 (2024-02-10) .SS Bugfixes .INDENT 0.0 .IP \(bu 2 Use \fBemail.message\fP instead of \fBcgi\fP as \fBcgi\fP has been deprecated (\fI\%#969\fP) .UNINDENT .SS Misc .INDENT 0.0 .IP \(bu 2 \fI\%#931\fP, \fI\%#991\fP, \fI\%#1028\fP, \fI\%#1040\fP .UNINDENT .SH TWINE 4.0.2 (2022-11-30) .SS Bugfixes .INDENT 0.0 .IP \(bu 2 Remove deprecated function to fix \fBtwine check\fP with pkginfo 1.9.0. (\fI\%#941\fP) .UNINDENT .SH TWINE 4.0.1 (2022-06-01) .SS Bugfixes .INDENT 0.0 .IP \(bu 2 Improve logging when keyring fails. (\fI\%#890\fP) .IP \(bu 2 Reconfigure root logger to show all log messages. (\fI\%#896\fP) .UNINDENT .SH TWINE 4.0.0 (2022-03-31) .SS Features .INDENT 0.0 .IP \(bu 2 Drop support for Python 3.6. (\fI\%#869\fP) .IP \(bu 2 Use Rich to add color to \fBupload\fP output. (\fI\%#851\fP) .IP \(bu 2 Use Rich to add color to \fBcheck\fP output. (\fI\%#874\fP) .IP \(bu 2 Use Rich instead of tqdm for upload progress bar. (\fI\%#877\fP) .UNINDENT .SS Bugfixes .INDENT 0.0 .IP \(bu 2 Remove Twine\(aqs dependencies from the \fBUser\-Agent\fP header when uploading. (\fI\%#871\fP) .IP \(bu 2 Improve detection of disabled BLAKE2 hashing due to FIPS mode. (\fI\%#879\fP) .IP \(bu 2 Restore warning for missing \fBlong_description\fP\&. (\fI\%#887\fP) .UNINDENT .SH TWINE 3.8.0 (2022-02-02) .SS Features .INDENT 0.0 .IP \(bu 2 Add \fB\-\-verbose\fP logging for querying keyring credentials. (\fI\%#849\fP) .IP \(bu 2 Log all upload responses with \fB\-\-verbose\fP\&. (\fI\%#859\fP) .IP \(bu 2 Show more helpful error message for invalid metadata. (\fI\%#861\fP) .UNINDENT .SS Bugfixes .INDENT 0.0 .IP \(bu 2 Require a recent version of urllib3. (\fI\%#858\fP) .UNINDENT .SH TWINE 3.7.1 (2021-12-07) .SS Improved Documentation .INDENT 0.0 .IP \(bu 2 Fix broken link to packaging tutorial. (\fI\%#844\fP) .UNINDENT .SH TWINE 3.7.0 (2021-12-01) .SS Features .INDENT 0.0 .IP \(bu 2 Add support for core metadata version 2.2, defined in PEP 643. (\fI\%#833\fP) .UNINDENT .SH TWINE 3.6.0 (2021-11-10) .SS Features .INDENT 0.0 .IP \(bu 2 Add support for Python 3.10. (\fI\%#827\fP) .UNINDENT .SH TWINE 3.5.0 (2021-11-02) .SS Features .INDENT 0.0 .IP \(bu 2 Show more helpful messages for invalid passwords. (\fI\%#815\fP) .IP \(bu 2 Allow the \fB\-\-skip\-existing\fP option to work with GCP Artifact Registry. (\fI\%#823\fP) .UNINDENT .SS Bugfixes .INDENT 0.0 .IP \(bu 2 Add a helpful error message when an upload fails due to missing a trailing slash in the URL. (\fI\%#812\fP) .IP \(bu 2 Generalize \fB\-\-verbose\fP suggestion when an upload fails. (\fI\%#817\fP) .UNINDENT .SH TWINE 3.4.2 (2021-07-20) .SS Bugfixes .INDENT 0.0 .IP \(bu 2 Improve error message for unsupported metadata. (\fI\%#755\fP) .IP \(bu 2 Improve error message for a missing config file. (\fI\%#770\fP) .IP \(bu 2 Do not include md5_digest or blake2_256_digest if FIPS mode is enabled on the host. This removes those fields from the metadata before sending the metadata to the repository. (\fI\%#776\fP) .UNINDENT .SH TWINE 3.4.1 (2021-03-16) .SS Bugfixes .INDENT 0.0 .IP \(bu 2 Fix a regression that was causing some namespace packages with dots in them fail to upload to PyPI. (\fI\%#745\fP) .UNINDENT .SH TWINE 3.4.0 (2021-03-15) .SS Features .INDENT 0.0 .IP \(bu 2 Prefer importlib.metadata for entry point handling. (\fI\%#728\fP) .IP \(bu 2 Rely on importlib_metadata 3.6 for nicer entry point processing. (\fI\%#732\fP) .IP \(bu 2 Eliminate dependency on setuptools/pkg_resources and replace with packaging and importlib_metadata. (\fI\%#736\fP) .UNINDENT .SH TWINE 3.3.0 (2020-12-23) .SS Features .INDENT 0.0 .IP \(bu 2 Print files to be uploaded using \fBupload \-\-verbose\fP (\fI\%#670\fP) .IP \(bu 2 Print configuration file location when using \fBupload \-\-verbose\fP (\fI\%#675\fP) .IP \(bu 2 Print source and values of credentials when using \fBupload \-\-verbose\fP (\fI\%#685\fP) .IP \(bu 2 Add support for Python 3.9 (\fI\%#708\fP) .IP \(bu 2 Turn warnings into errors when using \fBcheck \-\-strict\fP (\fI\%#715\fP) .UNINDENT .SS Bugfixes .INDENT 0.0 .IP \(bu 2 Make password optional when using \fBupload \-\-client\-cert\fP (\fI\%#678\fP) .IP \(bu 2 Support more Nexus versions with \fBupload \-\-skip\-existing\fP (\fI\%#693\fP) .IP \(bu 2 Support Gitlab Enterprise with \fBupload \-\-skip\-existing\fP (\fI\%#698\fP) .IP \(bu 2 Show a better error message for malformed files (\fI\%#714\fP) .UNINDENT .SS Improved Documentation .INDENT 0.0 .IP \(bu 2 Adopt PSF code of conduct (\fI\%#680\fP) .IP \(bu 2 Adopt towncrier for the changleog (\fI\%#718\fP) .UNINDENT .SH TWINE 3.2.0 (2020-06-24) .SS Features .INDENT 0.0 .IP \(bu 2 Improve display of HTTP errors during upload (\fI\%#666\fP) .IP \(bu 2 Print packages and signatures to be uploaded when using \fB\-\-verbose\fP option (\fI\%#652\fP) .IP \(bu 2 Use red text when printing errors on the command line (\fI\%#649\fP) .IP \(bu 2 Require repository URL scheme to be \fBhttp\fP or \fBhttps\fP (\fI\%#602\fP) .IP \(bu 2 Add type annotations, checked with mypy, with \fI\%PEP 561\fP support for users of Twine\(aqs API (\fI\%#231\fP) .UNINDENT .SS Bugfixes .INDENT 0.0 .IP \(bu 2 Update URL to \fB\&.pypirc\fP specification (\fI\%#655\fP) .IP \(bu 2 Don\(aqt raise an exception when Python version can\(aqt be parsed from filename (\fI\%#612\fP) .IP \(bu 2 Fix inaccurate retry message during \fBupload\fP (\fI\%#611\fP) .IP \(bu 2 Clarify error messages for archive format (\fI\%#601\fP) .UNINDENT .SH TWINE 3.1.1 (2019-11-27) .SS Bugfixes .INDENT 0.0 .IP \(bu 2 Restore \fB\-\-non\-interactive\fP as a flag not expecting an argument. (\fI\%#548\fP) .UNINDENT .SH TWINE 3.1.0 (2019-11-23) .SS Features .INDENT 0.0 .IP \(bu 2 Add support for specifying \fB\-\-non\-interactive\fP as an environment variable. (\fI\%#547\fP) .UNINDENT .SH TWINE 3.0.0 (2019-11-18) .SS Features .INDENT 0.0 .IP \(bu 2 When a client certificate is indicated, all password processing is disabled. (\fI\%#336\fP) .IP \(bu 2 Add \fB\-\-non\-interactive\fP flag to abort upload rather than interactively prompt if credentials are missing. (\fI\%#489\fP) .IP \(bu 2 Twine now unconditionally requires the keyring library and no longer supports uninstalling \fBkeyring\fP as a means to disable that functionality. Instead, use \fBkeyring \-\-disable\fP keyring functionality if necessary. (\fI\%#524\fP) .IP \(bu 2 Add Python 3.8 to classifiers. (\fI\%#518\fP) .UNINDENT .SS Bugfixes .INDENT 0.0 .IP \(bu 2 More robust handling of server response in \fB\-\-skip\-existing\fP (\fI\%#332\fP) .UNINDENT .SH TWINE 2.0.0 (2019-09-24) .SS Features .INDENT 0.0 .IP \(bu 2 Twine now requires Python 3.6 or later. Use pip 9 or pin to \(dqtwine<2\(dq to install twine on older Python versions. (\fI\%#437\fP) .UNINDENT .SS Bugfixes .INDENT 0.0 .IP \(bu 2 Require requests 2.20 or later to avoid reported security vulnerabilities in earlier releases. (\fI\%#491\fP) .UNINDENT .SH TWINE 1.15.0 (2019-09-17) .SS Features .INDENT 0.0 .IP \(bu 2 Improved output on \fBcheck\fP command: Prints a message when there are no distributions given to check. Improved handling of errors in a distribution\(aqs markup, avoiding messages flowing through to the next distribution\(aqs errors. (\fI\%#488\fP) .UNINDENT .SH TWINE 1.14.0 (2019-09-06) .SS Features .INDENT 0.0 .IP \(bu 2 Show Warehouse URL after uploading a package (\fI\%#459\fP) .IP \(bu 2 Better error handling and gpg2 fallback if gpg not available. (\fI\%#456\fP) .IP \(bu 2 Now provide a more meaningful error on redirect during upload. (\fI\%#310\fP) .UNINDENT .SS Bugfixes .INDENT 0.0 .IP \(bu 2 Fail more gracefully when encountering bad metadata (\fI\%#341\fP) .UNINDENT .SH TWINE 1.13.0 (2019-02-13) .SS Features .INDENT 0.0 .IP \(bu 2 Add disable_progress_bar option to disable tqdm. (\fI\%#427\fP) .IP \(bu 2 Allow defining an empty username and password in .pypirc. (\fI\%#426\fP) .IP \(bu 2 Support keyring.get_credential. (\fI\%#419\fP) .IP \(bu 2 Support keyring.get_username_and_password. (\fI\%#418\fP) .IP \(bu 2 Add Python 3.7 to classifiers. (\fI\%#416\fP) .UNINDENT .SS Bugfixes .INDENT 0.0 .IP \(bu 2 Restore prompts while retaining support for suppressing prompts. (\fI\%#452\fP) .IP \(bu 2 Avoid requests\-toolbelt to 0.9.0 to prevent attempting to use openssl when it isn\(aqt available. (\fI\%#447\fP) .IP \(bu 2 Use io.StringIO instead of StringIO. (\fI\%#444\fP) .IP \(bu 2 Only install pyblake2 if needed. (\fI\%#441\fP) .IP \(bu 2 Use modern Python language features. (\fI\%#436\fP) .IP \(bu 2 Specify python_requires in setup.py (\fI\%#435\fP) .IP \(bu 2 Use https URLs everywhere. (\fI\%#432\fP) .IP \(bu 2 Fix \-\-skip\-existing for Nexus Repos. (\fI\%#428\fP) .IP \(bu 2 Remove unnecessary usage of readme_render.markdown. (\fI\%#421\fP) .IP \(bu 2 Don\(aqt crash if there\(aqs no package description. (\fI\%#412\fP) .IP \(bu 2 Fix keyring support. (\fI\%#408\fP) .UNINDENT .SS Misc .INDENT 0.0 .IP \(bu 2 Refactor tox env and travis config. (\fI\%#439\fP) .UNINDENT .SH TWINE 1.12.1 (2018-09-24) .SS Bugfixes .INDENT 0.0 .IP \(bu 2 Fix regression with upload exit code (\fI\%#404\fP) .UNINDENT .SH TWINE 1.12.0 (2018-09-24) .SS Features .INDENT 0.0 .IP \(bu 2 Add \fBtwine check\fP command to check long description (\fI\%#395\fP) .IP \(bu 2 Drop support for Python 3.3 (\fI\%#392\fP) .IP \(bu 2 Empower \fB\-\-skip\-existing\fP for Artifactory repositories (\fI\%#363\fP) .UNINDENT .SS Bugfixes .INDENT 0.0 .IP \(bu 2 Avoid MD5 when Python is compiled in FIPS mode (\fI\%#367\fP) .UNINDENT .SH TWINE 1.11.0 (2018-03-19) .SS Features .INDENT 0.0 .IP \(bu 2 Remove PyPI as default \fBregister\fP package index. (\fI\%#320\fP) .IP \(bu 2 Support Metadata 2.1 (\fI\%PEP 566\fP), including Markdown for \fBdescription\fP fields. (\fI\%#319\fP) .UNINDENT .SS Bugfixes .INDENT 0.0 .IP \(bu 2 Raise exception if attempting upload to deprecated legacy PyPI URLs. (\fI\%#322\fP) .IP \(bu 2 Avoid uploading to PyPI when given alternate repository URL, and require \fBhttp://\fP or \fBhttps://\fP in \fBrepository_url\fP\&. (\fI\%#269\fP) .UNINDENT .SS Misc .INDENT 0.0 .IP \(bu 2 \fI\%Update PyPI URLs\fP\&. (\fI\%#318\fP) .IP \(bu 2 Add new maintainer, release checklists. (\fI\%#314\fP) .IP \(bu 2 Add instructions on how to use keyring. (\fI\%#277\fP) .UNINDENT .SH TWINE 1.10.0 (2018-03-07) .SS Features .INDENT 0.0 .IP \(bu 2 Link to changelog from \fBREADME\fP (\fI\%#46\fP) .IP \(bu 2 Reorganize & improve user & developer documentation. (\fI\%#304\fP) .IP \(bu 2 Revise docs predicting future of \fBtwine\fP (\fI\%#303\fP) .IP \(bu 2 Add architecture overview to docs (\fI\%#296\fP) .IP \(bu 2 Add doc building instructions (\fI\%#295\fP) .IP \(bu 2 Declare support for Python 3.6 (\fI\%#257\fP) .IP \(bu 2 Improve progressbar (\fI\%#256\fP) .UNINDENT .SS Bugfixes .INDENT 0.0 .IP \(bu 2 Degrade gracefully when keyring is unavailable (\fI\%#315\fP) .IP \(bu 2 Fix changelog formatting (\fI\%#299\fP) .IP \(bu 2 Fix syntax highlighting in \fBREADME\fP (\fI\%#298\fP) .IP \(bu 2 Fix Read the Docs, tox, Travis configuration (\fI\%#297\fP) .IP \(bu 2 Fix Travis CI and test configuration (\fI\%#286\fP) .IP \(bu 2 Print progress to \fBstdout\fP, not \fBstderr\fP (\fI\%#268\fP) .IP \(bu 2 Fix \fB\-\-repository[\-url]\fP help text (\fI\%#265\fP) .IP \(bu 2 Remove obsolete registration guidance (\fI\%#200\fP) .UNINDENT .SH TWINE 1.9.1 (2017-05-27) .SS Bugfixes .INDENT 0.0 .IP \(bu 2 Blacklist known bad versions of Requests. (\fI\%#253\fP) .UNINDENT .SH TWINE 1.9.0 (2017-05-22) .SS Bugfixes .INDENT 0.0 .IP \(bu 2 Twine sends less information about the user\(aqs system in the User\-Agent string. (\fI\%#229\fP) .IP \(bu 2 Fix \fB\-\-skip\-existing\fP when used to upload a package for the first time. (\fI\%#220\fP) .IP \(bu 2 Fix precedence of \fB\-\-repository\-url\fP over \fB\-\-repository\fP\&. (\fI\%#206\fP) .UNINDENT .SS Misc .INDENT 0.0 .IP \(bu 2 Twine will now resolve passwords using the \fI\%keyring\fP if available. Module can be required with the \fBkeyring\fP extra. .IP \(bu 2 Twine will use \fBhashlib.blake2b\fP on Python 3.6+ instead of pyblake2 .UNINDENT .SH TWINE 1.8.1 (2016-08-09) .SS Misc .INDENT 0.0 .IP \(bu 2 Check if a package exists if the URL is one of: .INDENT 2.0 .INDENT 3.5 .INDENT 0.0 .IP \(bu 2 \fBhttps://pypi.python.org/pypi/\fP .IP \(bu 2 \fBhttps://upload.pypi.org/\fP .IP \(bu 2 \fBhttps://upload.pypi.io/\fP .UNINDENT .sp This helps people with \fBhttps://upload.pypi.io\fP still in their \fB\&.pypirc\fP file. .UNINDENT .UNINDENT .UNINDENT .SH TWINE 1.8.0 (2016-08-08) .SS Features .INDENT 0.0 .IP \(bu 2 Switch from upload.pypi.io to upload.pypi.org. (\fI\%#201\fP) .IP \(bu 2 Retrieve configuration from the environment as a default. (\fI\%#144\fP) .INDENT 2.0 .INDENT 3.5 .INDENT 0.0 .IP \(bu 2 Repository URL will default to \fBTWINE_REPOSITORY\fP .IP \(bu 2 Username will default to \fBTWINE_USERNAME\fP .IP \(bu 2 Password will default to \fBTWINE_PASSWORD\fP .UNINDENT .UNINDENT .UNINDENT .IP \(bu 2 Allow the Repository URL to be provided on the command\-line (\fB\-\-repository\-url\fP) or via an environment variable (\fBTWINE_REPOSITORY_URL\fP). (\fI\%#166\fP) .IP \(bu 2 Generate Blake2b 256 digests for packages \fIif\fP \fBpyblake2\fP is installed. Users can use \fBpython \-m pip install twine[with\-blake2]\fP to have \fBpyblake2\fP installed with Twine. (\fI\%#171\fP) .UNINDENT .SS Misc .INDENT 0.0 .IP \(bu 2 Generate SHA256 digest for all packages by default. .IP \(bu 2 Stop testing on Python 2.6. .IP \(bu 2 Warn users if they receive a 500 error when uploading to \fB*pypi.python.org\fP (\fI\%#199\fP) .UNINDENT .SH TWINE 1.7.4 (2016-07-09) .SS Bugfixes .INDENT 0.0 .IP \(bu 2 Correct a packaging error. .UNINDENT .SH TWINE 1.7.3 (2016-07-08) .SS Bugfixes .INDENT 0.0 .IP \(bu 2 Fix uploads to instances of pypiserver using \fB\-\-skip\-existing\fP\&. We were not properly checking the return status code on the response after attempting an upload. (\fI\%#195\fP) .UNINDENT .SS Misc .INDENT 0.0 .IP \(bu 2 Avoid attempts to upload a package if we can find it on Legacy PyPI. .UNINDENT .SH TWINE 1.7.2 (2016-07-05) .SS Bugfixes .INDENT 0.0 .IP \(bu 2 Fix issue where we were checking the existence of packages even if the user didn\(aqt specify \fB\-\-skip\-existing\fP\&. (\fI\%#189\fP) (\fI\%#191\fP) .UNINDENT .SH TWINE 1.7.1 (2016-07-05) .SS Bugfixes .INDENT 0.0 .IP \(bu 2 Clint was not specified in the wheel metadata as a dependency. (\fI\%#187\fP) .UNINDENT .SH TWINE 1.7.0 (2016-07-04) .SS Features .INDENT 0.0 .IP \(bu 2 Support \fB\-\-cert\fP and \fB\-\-client\-cert\fP command\-line flags and config file options for feature parity with pip. This allows users to verify connections to servers other than PyPI (e.g., local package repositories) with different certificates. (\fI\%#142\fP) .IP \(bu 2 Add progress bar to uploads. (\fI\%#152\fP) .IP \(bu 2 Allow \fB\-\-skip\-existing\fP to work for 409 status codes. (\fI\%#162\fP) .IP \(bu 2 Implement retries when the CDN in front of PyPI gives us a 5xx error. (\fI\%#167\fP) .IP \(bu 2 Switch Twine to upload to pypi.io instead of pypi.python.org. (\fI\%#177\fP) .UNINDENT .SS Bugfixes .INDENT 0.0 .IP \(bu 2 Allow passwords to have \fB%\fPs in them. (\fI\%#186\fP) .UNINDENT .SH TWINE 1.6.5 (2015-12-16) .SS Bugfixes .INDENT 0.0 .IP \(bu 2 Bump requests\-toolbelt version to ensure we avoid ConnectionErrors (\fI\%#155\fP) .UNINDENT .SH TWINE 1.6.4 (2015-10-27) .SS Bugfixes .INDENT 0.0 .IP \(bu 2 Paths with hyphens in them break the Wheel regular expression. (\fI\%#145\fP) .IP \(bu 2 Exception while accessing the \fBrepository\fP key (sic) when raising a redirect exception. (\fI\%#146\fP) .UNINDENT .SH TWINE 1.6.3 (2015-10-05) .SS Bugfixes .INDENT 0.0 .IP \(bu 2 Fix uploading signatures causing a 500 error after large file support was added. (\fI\%#137\fP, \fI\%#140\fP) .UNINDENT .SH TWINE 1.6.2 (2015-09-28) .SS Bugfixes .INDENT 0.0 .IP \(bu 2 Upload signatures with packages appropriately (\fI\%#132\fP) .INDENT 2.0 .INDENT 3.5 As part of the refactor for the 1.6.0 release, we were using the wrong name to find the signature file. .sp This also uncovered a bug where if you\(aqre using twine in a situation where \fB*\fP is not expanded by your shell, we might also miss uploading signatures to PyPI. Both were fixed as part of this. .UNINDENT .UNINDENT .UNINDENT .SH TWINE 1.6.1 (2015-09-18) .SS Bugfixes .INDENT 0.0 .IP \(bu 2 Fix signing support for uploads (\fI\%#130\fP) .UNINDENT .SH TWINE 1.6.0 (2015-09-14) .SS Features .INDENT 0.0 .IP \(bu 2 Allow the user to specify the location of their \fB\&.pypirc\fP (\fI\%#97\fP) .IP \(bu 2 Support registering new packages with \fBtwine register\fP (\fI\%#8\fP) .IP \(bu 2 Add the \fB\-\-skip\-existing\fP flag to \fBtwine upload\fP to allow users to skip releases that already exist on PyPI. (\fI\%#115\fP) .IP \(bu 2 Upload wheels first to PyPI (\fI\%#106\fP) .IP \(bu 2 Large file support via the \fBrequests\-toolbelt\fP (\fI\%#104\fP) .UNINDENT .SS Bugfixes .INDENT 0.0 .IP \(bu 2 Raise an exception on redirects (\fI\%#92\fP) .IP \(bu 2 Work around problems with Windows when using \fBgetpass.getpass\fP (\fI\%#116\fP) .IP \(bu 2 Warnings triggered by pkginfo searching for \fBPKG\-INFO\fP files should no longer be user visible. (\fI\%#114\fP) .IP \(bu 2 Provide more helpful messages if \fB\&.pypirc\fP is out of date. (\fI\%#111\fP) .UNINDENT .SH TWINE 1.5.0 (2015-03-10) .SS Features .INDENT 0.0 .IP \(bu 2 Support commands not named \(dqgpg\(dq for signing (\fI\%#29\fP) .UNINDENT .SS Bugfixes .INDENT 0.0 .IP \(bu 2 Display information about the version of setuptools installed (\fI\%#85\fP) .IP \(bu 2 Support deprecated pypirc file format (\fI\%#61\fP) .UNINDENT .SS Misc .INDENT 0.0 .IP \(bu 2 Add lower\-limit to requests dependency .UNINDENT .SH TWINE 1.4.0 (2014-12-12) .SS Features .INDENT 0.0 .IP \(bu 2 Switch to a git style dispatching for the commands to enable simpler commands and programmatic invocation. (\fI\%#6\fP) .IP \(bu 2 Parse \fB~/.pypirc\fP ourselves and use \fBsubprocess\fP instead of the \fBdistutils.spawn\fP module. (\fI\%#13\fP) .UNINDENT .SS Bugfixes .INDENT 0.0 .IP \(bu 2 Expand globs and check for existence of dists to upload (\fI\%#65\fP) .IP \(bu 2 Fix issue uploading packages with \fB_\fPs in the name (\fI\%#47\fP) .IP \(bu 2 List registered commands in help text (\fI\%#34\fP) .IP \(bu 2 Use \fBpkg_resources\fP to load registered commands (\fI\%#32\fP) .IP \(bu 2 Prevent ResourceWarning from being shown (\fI\%#28\fP) .IP \(bu 2 Add support for uploading Windows installers (\fI\%#26\fP) .UNINDENT .SH TWINE 1.3.0 (2014-03-31) .SS Features .INDENT 0.0 .IP \(bu 2 Additional functionality. .UNINDENT .SH TWINE 1.2.2 (2013-10-03) .SS Features .INDENT 0.0 .IP \(bu 2 Basic functionality. .UNINDENT .sp We are happy you have decided to contribute to Twine. .sp Please see \fI\%the GitHub repository\fP for code and more documentation, and the \fI\%official Python Packaging User Guide\fP for user documentation. To ask questions or get involved, you can join the \fI\%Python Packaging Discourse forum\fP, \fB#pypa\fP or \fB#pypa\-dev\fP on \fI\%IRC\fP, or the \fI\%distutils\-sig mailing list\fP\&. .sp Everyone interacting in the Twine project\(aqs codebases, issue trackers, chat rooms, and mailing lists is expected to follow the \fI\%PSF Code of Conduct\fP\&. .SH GETTING STARTED .sp We use \fI\%tox\fP to run tests, check code style, and build the documentation. To install \fBtox\fP, run: .INDENT 0.0 .INDENT 3.5 .sp .EX python3 \-m pip install tox .EE .UNINDENT .UNINDENT .sp Clone the twine repository from GitHub, then run: .INDENT 0.0 .INDENT 3.5 .sp .EX cd /path/to/your/local/twine tox \-e dev .EE .UNINDENT .UNINDENT .sp This creates a \fI\%virtual environment\fP, so that twine and its dependencies do not interfere with other packages installed on your machine. In the virtual environment, \fBtwine\fP is pointing at your local copy, so when you make changes, you can easily see their effect. .sp The virtual environment also contains the tools for running tests and checking code style, so you can run them on single files directly or in your code editor. However, we still encourage using the \fBtox\fP commands below on the whole codebase. .sp To use the virtual environment, run: .INDENT 0.0 .INDENT 3.5 .sp .EX source venv/bin/activate .EE .UNINDENT .UNINDENT .SS Building the documentation .sp Additions and edits to twine\(aqs documentation are welcome and appreciated. .sp To preview the docs while you\(aqre making changes, run: .INDENT 0.0 .INDENT 3.5 .sp .EX tox \-e watch\-docs .EE .UNINDENT .UNINDENT .sp Then open a web browser to \fI\%http://127.0.0.1:8000\fP\&. .sp When you\(aqre done making changes, lint and build the docs locally before making a pull request. In your active virtual environment, run: .INDENT 0.0 .INDENT 3.5 .sp .EX tox \-e docs .EE .UNINDENT .UNINDENT .sp The HTML of the docs will be written to \fBdocs/_build/html\fP\&. .SS Code style .sp To automatically reformat your changes with \fI\%isort\fP and \fI\%black\fP, run: .INDENT 0.0 .INDENT 3.5 .sp .EX tox \-e format .EE .UNINDENT .UNINDENT .sp To detect any remaining code smells with \fI\%flake8\fP, run: .INDENT 0.0 .INDENT 3.5 .sp .EX tox \-e lint .EE .UNINDENT .UNINDENT .sp To perform strict type\-checking using \fI\%mypy\fP, run: .INDENT 0.0 .INDENT 3.5 .sp .EX tox \-e types .EE .UNINDENT .UNINDENT .sp Any errors from \fBlint\fP or \fBtypes\fP need to be fixed manually. .sp Additionally, we prefer that \fBimport\fP statements be used for packages and modules only, rather than individual classes or functions. .SS Testing .sp We use \fI\%pytest\fP for writing and running tests. .sp To run the tests in your virtual environment, run: .INDENT 0.0 .INDENT 3.5 .sp .EX tox \-e py .EE .UNINDENT .UNINDENT .sp To pass options to \fBpytest\fP, e.g. the name of a test, run: .INDENT 0.0 .INDENT 3.5 .sp .EX tox \-e py \-\- tests/test_upload.py::test_exception_for_http_status .EE .UNINDENT .UNINDENT .sp Twine is continuously tested against supported versions of Python using \fI\%GitHub Actions\fP\&. To run the tests against a specific version, e.g. Python 3.8, you will need it installed on your machine. Then, run: .INDENT 0.0 .INDENT 3.5 .sp .EX tox \-e py38 .EE .UNINDENT .UNINDENT .sp To run the \(dqintegration\(dq tests of uploading to real package indexes, run: .INDENT 0.0 .INDENT 3.5 .sp .EX tox \-e integration .EE .UNINDENT .UNINDENT .sp To run the tests against all supported Python versions, check code style, and build the documentation, run: .INDENT 0.0 .INDENT 3.5 .sp .EX tox .EE .UNINDENT .UNINDENT .SH SUBMITTING CHANGES .INDENT 0.0 .IP 1. 3 Fork \fI\%the GitHub repository\fP\&. .IP 2. 3 Make a branch off of \fBmain\fP and commit your changes to it. .IP 3. 3 Run the tests, check code style, and build the docs as described above. .IP 4. 3 Optionally, add your name to the end of the \fBAUTHORS\fP file using the format \fBName (url)\fP, where the \fB(url)\fP portion is optional. .IP 5. 3 Submit a pull request to the \fBmain\fP branch on GitHub, referencing an open issue. .IP 6. 3 Add a changelog entry. .UNINDENT .SS Changelog entries .sp The \fBdocs/changelog.rst\fP file is built by \fI\%towncrier\fP from files in the \fBchangelog/\fP directory. To add an entry, create a file in that directory named \fB{number}.{type}.rst\fP, where \fB{number}\fP is the pull request number, and \fB{type}\fP is \fBfeature\fP, \fBbugfix\fP, \fBdoc\fP, \fBremoval\fP, or \fBmisc\fP\&. .sp For example, if your PR number is 1234 and it\(aqs fixing a bug, then you would create \fBchangelog/1234.bugfix.rst\fP\&. PRs can span multiple categories by creating multiple files: if you added a feature and deprecated/removed an old feature in PR #5678, you would create \fBchangelog/5678.feature.rst\fP and \fBchangelog/5678.removal.rst\fP\&. .sp A changelog entry is meant for end users and should only contain details relevant to them. In order to maintain a consistent style, please keep the entry to the point, in sentence case, shorter than 80 characters, and in an imperative tone. An entry should complete the sentence \(dqThis change will ...\(dq. If one line is not enough, use a summary line in an imperative tone, followed by a description of the change in one or more paragraphs, each wrapped at 80 characters and separated by blank lines. .sp You don\(aqt need to reference the pull request or issue number in a changelog entry, since towncrier will add a link using the number in the file name, and the pull request should reference an issue number. Similarly, you don\(aqt need to add your name to the entry, since that will be associated with the pull request. .sp Changelog entries are rendered using \fI\%reStructuredText\fP, but they should only have minimal formatting (such as \fB\(ga\(gamonospaced text\(ga\(ga\fP). .SH ARCHITECTURAL OVERVIEW .sp Twine is a command\-line tool for interacting with PyPI securely over HTTPS. Its three purposes are to be: .INDENT 0.0 .IP 1. 3 A user\-facing tool for publishing on pypi.org .IP 2. 3 A user\-facing tool for publishing on other Python package indexes (e.g., \fBdevpi\fP instances) .IP 3. 3 A useful API for other programs (e.g., \fBzest.releaser\fP) to call for publishing on any Python package index .UNINDENT .sp Currently, twine has two principle functions: uploading new packages and registering new \fI\%projects\fP (\fBregister\fP is no longer supported on PyPI, and is in Twine for use with other package indexes). .sp Its command line arguments are parsed in \fBtwine/cli.py\fP\&. The code for registering new projects is in \fBtwine/commands/register.py\fP, and the code for uploading is in \fBtwine/commands/upload.py\fP\&. The file \fBtwine/package.py\fP contains a single class, \fBPackageFile\fP, which hashes the project files and extracts their metadata. The file \fBtwine/repository.py\fP contains the \fBRepository\fP class, whose methods control the URL the package is uploaded to (which the user can specify either as a default, in the \fB\&.pypirc\fP file, or pass on the command line), and the methods that upload the package securely to a URL. .sp For more details, refer to the source documentation (currently a \fI\%work in progress\fP): .SS twine package .sp Top\-level module for Twine. .sp The contents of this package are not a public API. For more details, see \fI\%https://github.com/pypa/twine/issues/194\fP and \fI\%https://github.com/pypa/twine/issues/665\fP\&. .SS twine.commands package .sp Module containing the logic for the \fBtwine\fP sub\-commands. .sp The contents of this package are not a public API. For more details, see \fI\%https://github.com/pypa/twine/issues/194\fP and \fI\%https://github.com/pypa/twine/issues/665\fP\&. .SS twine.commands.check module .sp Module containing the logic for \fBtwine check\fP\&. .INDENT 0.0 .TP .B class twine.commands.check._WarningStream .INDENT 7.0 .TP .B write(text: \fI\%str\fP) -> \fI\%int\fP Write string to file. .sp Returns the number of characters written, which is always equal to the length of the string. .UNINDENT .UNINDENT .INDENT 0.0 .TP .B twine.commands.check._parse_content_type(value: \fI\%str\fP) -> \fI\%Tuple\fP[\fI\%str\fP, \fI\%Dict\fP[\fI\%str\fP, \fI\%str\fP]] Implement logic of deprecated cgi.parse_header(). .sp From \fI\%https://docs.python.org/3.11/library/cgi.html#cgi.parse_header\fP\&. .UNINDENT .INDENT 0.0 .TP .B twine.commands.check._check_file(filename: \fI\%str\fP, render_warning_stream: \fI\%_WarningStream\fP) -> \fI\%Tuple\fP[\fI\%List\fP[\fI\%str\fP], \fI\%bool\fP] Check given distribution. .UNINDENT .INDENT 0.0 .TP .B twine.commands.check.check(dists: \fI\%List\fP[\fI\%str\fP], strict: \fI\%bool\fP = False) -> \fI\%bool\fP Check that a distribution will render correctly on PyPI and display the results. .sp This is currently only validates \fBlong_description\fP, but more checks could be added; see \fI\%https://github.com/pypa/twine/projects/2\fP\&. .INDENT 7.0 .TP .B Parameters .INDENT 7.0 .IP \(bu 2 \fBdists\fP \-\- The distribution files to check. .IP \(bu 2 \fBoutput_stream\fP \-\- The destination of the resulting output. .IP \(bu 2 \fBstrict\fP \-\- If \fBTrue\fP, treat warnings as errors. .UNINDENT .TP .B Returns \fBTrue\fP if there are rendering errors, otherwise \fBFalse\fP\&. .UNINDENT .UNINDENT .INDENT 0.0 .TP .B twine.commands.check.main(args: \fI\%List\fP[\fI\%str\fP]) -> \fI\%bool\fP Execute the \fBcheck\fP command. .INDENT 7.0 .TP .B Parameters \fBargs\fP \-\- The command\-line arguments. .TP .B Returns The exit status of the \fBcheck\fP command. .UNINDENT .UNINDENT .SS twine.commands.register module .sp Module containing the logic for \fBtwine register\fP\&. .INDENT 0.0 .TP .B twine.commands.register.register(register_settings: \fI\%Settings\fP, package: \fI\%str\fP) -> \fI\%None\fP Pre\-register a package name with a repository before uploading a distribution. .sp Pre\-registration is not supported on PyPI, so the \fBregister\fP command is only necessary if you are using a different repository that requires it. .INDENT 7.0 .TP .B Parameters .INDENT 7.0 .IP \(bu 2 \fBregister_settings\fP \-\- The configured options relating to repository registration. .IP \(bu 2 \fBpackage\fP \-\- The path of the distribution to use for package metadata. .UNINDENT .TP .B Raises .INDENT 7.0 .IP \(bu 2 \fI\%twine.exceptions.TwineException\fP \-\- The registration failed due to a configuration error. .IP \(bu 2 \fI\%requests.HTTPError\fP \-\- The repository responded with an error. .UNINDENT .UNINDENT .UNINDENT .INDENT 0.0 .TP .B twine.commands.register.main(args: \fI\%List\fP[\fI\%str\fP]) -> \fI\%None\fP Execute the \fBregister\fP command. .INDENT 7.0 .TP .B Parameters \fBargs\fP \-\- The command\-line arguments. .UNINDENT .UNINDENT .SS twine.commands.upload module .sp Module containing the logic for \fBtwine upload\fP\&. .INDENT 0.0 .TP .B twine.commands.upload.skip_upload(response: \fI\%Response\fP, skip_existing: \fI\%bool\fP, package: \fI\%PackageFile\fP) -> \fI\%bool\fP Determine if a failed upload is an error or can be safely ignored. .INDENT 7.0 .TP .B Parameters .INDENT 7.0 .IP \(bu 2 \fBresponse\fP \-\- The response from attempting to upload \fBpackage\fP to a repository. .IP \(bu 2 \fBskip_existing\fP \-\- If \fBTrue\fP, use the status and content of \fBresponse\fP to determine if the package already exists on the repository. If so, then a failed upload is safe to ignore. .IP \(bu 2 \fBpackage\fP \-\- The package that was being uploaded. .UNINDENT .TP .B Returns \fBTrue\fP if a failed upload can be safely ignored, otherwise \fBFalse\fP\&. .UNINDENT .UNINDENT .INDENT 0.0 .TP .B twine.commands.upload._make_package(filename: \fI\%str\fP, signatures: \fI\%Dict\fP[\fI\%str\fP, \fI\%str\fP], upload_settings: \fI\%Settings\fP) -> \fI\%PackageFile\fP Create and sign a package, based off of filename, signatures and settings. .UNINDENT .INDENT 0.0 .TP .B twine.commands.upload.upload(upload_settings: \fI\%Settings\fP, dists: \fI\%List\fP[\fI\%str\fP]) -> \fI\%None\fP Upload one or more distributions to a repository, and display the progress. .sp If a package already exists on the repository, most repositories will return an error response. However, if \fBupload_settings.skip_existing\fP is \fBTrue\fP, a message will be displayed and any remaining distributions will be uploaded. .sp For known repositories (like PyPI), the web URLs of successfully uploaded packages will be displayed. .INDENT 7.0 .TP .B Parameters .INDENT 7.0 .IP \(bu 2 \fBupload_settings\fP \-\- The configured options related to uploading to a repository. .IP \(bu 2 \fBdists\fP \-\- The distribution files to upload to the repository. This can also include \fB\&.asc\fP files; the GPG signatures will be added to the corresponding uploads. .UNINDENT .TP .B Raises .INDENT 7.0 .IP \(bu 2 \fI\%twine.exceptions.TwineException\fP \-\- The upload failed due to a configuration error. .IP \(bu 2 \fI\%requests.HTTPError\fP \-\- The repository responded with an error. .UNINDENT .UNINDENT .UNINDENT .INDENT 0.0 .TP .B twine.commands.upload.main(args: \fI\%List\fP[\fI\%str\fP]) -> \fI\%None\fP Execute the \fBupload\fP command. .INDENT 7.0 .TP .B Parameters \fBargs\fP \-\- The command\-line arguments. .UNINDENT .UNINDENT .SS twine.auth module .INDENT 0.0 .TP .B class twine.auth.CredentialInput .INDENT 7.0 .TP .B __init__(username: \fI\%str\fP | \fI\%None\fP = None, password: \fI\%str\fP | \fI\%None\fP = None) -> \fI\%None\fP .UNINDENT .UNINDENT .INDENT 0.0 .TP .B class twine.auth.Resolver .INDENT 7.0 .TP .B __init__(config: \fI\%Dict\fP[\fI\%str\fP, \fI\%str\fP | \fI\%None\fP], input: \fI\%CredentialInput\fP) -> \fI\%None\fP .UNINDENT .INDENT 7.0 .TP .B classmethod choose(interactive: \fI\%bool\fP) -> \fI\%Type\fP[\fI\%Resolver\fP] .UNINDENT .INDENT 7.0 .TP .B property username: \fI\%str\fP | \fI\%None\fP .UNINDENT .INDENT 7.0 .TP .B property password: \fI\%str\fP | \fI\%None\fP .UNINDENT .INDENT 7.0 .TP .B property system: \fI\%str\fP | \fI\%None\fP .UNINDENT .INDENT 7.0 .TP .B get_username_from_keyring() -> \fI\%str\fP | \fI\%None\fP .UNINDENT .INDENT 7.0 .TP .B get_password_from_keyring() -> \fI\%str\fP | \fI\%None\fP .UNINDENT .INDENT 7.0 .TP .B username_from_keyring_or_prompt() -> \fI\%str\fP .UNINDENT .INDENT 7.0 .TP .B password_from_keyring_or_prompt() -> \fI\%str\fP .UNINDENT .INDENT 7.0 .TP .B prompt(what: \fI\%str\fP, how: \fI\%Callable\fP[[\&...], \fI\%str\fP]) -> \fI\%str\fP .UNINDENT .UNINDENT .INDENT 0.0 .TP .B class twine.auth.Private .INDENT 7.0 .TP .B prompt(what: \fI\%str\fP, how: \fI\%Callable\fP[[\&...], \fI\%str\fP] | \fI\%None\fP = None) -> \fI\%str\fP .UNINDENT .UNINDENT .SS twine.cli module .INDENT 0.0 .TP .B twine.cli.configure_output() -> \fI\%None\fP .UNINDENT .INDENT 0.0 .TP .B twine.cli.list_dependencies_and_versions() -> \fI\%List\fP[\fI\%Tuple\fP[\fI\%str\fP, \fI\%str\fP]] .UNINDENT .INDENT 0.0 .TP .B twine.cli.dep_versions() -> \fI\%str\fP .UNINDENT .INDENT 0.0 .TP .B twine.cli.dispatch(argv: \fI\%List\fP[\fI\%str\fP]) -> \fI\%Any\fP .UNINDENT .SS twine.exceptions module .sp Module containing exceptions raised by twine. .INDENT 0.0 .TP .B exception twine.exceptions.TwineException Base class for all exceptions raised by twine. .UNINDENT .INDENT 0.0 .TP .B exception twine.exceptions.RedirectDetected A redirect was detected that the user needs to resolve. .sp In some cases, requests refuses to issue a new POST request after a redirect. In order to prevent a confusing user experience, we raise this exception to allow users to know the index they\(aqre uploading to is redirecting them. .INDENT 7.0 .TP .B classmethod from_args(repository_url: \fI\%str\fP, redirect_url: \fI\%str\fP) -> \fI\%RedirectDetected\fP .UNINDENT .UNINDENT .INDENT 0.0 .TP .B exception twine.exceptions.PackageNotFound A package file was provided that could not be found on the file system. .sp This is only used when attempting to register a package_file. .UNINDENT .INDENT 0.0 .TP .B exception twine.exceptions.UploadToDeprecatedPyPIDetected An upload attempt was detected to deprecated PyPI domains. .sp The sites pypi.python.org and testpypi.python.org are deprecated. .INDENT 7.0 .TP .B classmethod from_args(target_url: \fI\%str\fP, default_url: \fI\%str\fP, test_url: \fI\%str\fP) -> \fI\%UploadToDeprecatedPyPIDetected\fP Return an UploadToDeprecatedPyPIDetected instance. .UNINDENT .UNINDENT .INDENT 0.0 .TP .B exception twine.exceptions.UnreachableRepositoryURLDetected An upload attempt was detected to a URL without a protocol prefix. .sp All repository URLs must have a protocol (e.g., \fBhttps://\fP). .UNINDENT .INDENT 0.0 .TP .B exception twine.exceptions.InvalidSigningConfiguration Both the sign and identity parameters must be present. .UNINDENT .INDENT 0.0 .TP .B exception twine.exceptions.InvalidSigningExecutable Signing executable must be installed on system. .UNINDENT .INDENT 0.0 .TP .B exception twine.exceptions.InvalidConfiguration Raised when configuration is invalid. .UNINDENT .INDENT 0.0 .TP .B exception twine.exceptions.InvalidDistribution Raised when a distribution is invalid. .UNINDENT .INDENT 0.0 .TP .B exception twine.exceptions.NonInteractive Raised in non\-interactive mode when credentials could not be found. .UNINDENT .INDENT 0.0 .TP .B exception twine.exceptions.InvalidPyPIUploadURL Repository configuration tries to use PyPI with an incorrect URL. .sp For example, \fI\%https://pypi.org\fP instead of \fI\%https://upload.pypi.org/legacy\fP\&. .UNINDENT .SS twine.package module .INDENT 0.0 .TP .B twine.package._safe_name(name: \fI\%str\fP) -> \fI\%str\fP Convert an arbitrary string to a standard distribution name. .sp Any runs of non\-alphanumeric/. characters are replaced with a single \(aq\-\(aq. .sp Copied from pkg_resources.safe_name for compatibility with warehouse. See \fI\%https://github.com/pypa/twine/issues/743\fP\&. .UNINDENT .INDENT 0.0 .TP .B class twine.package.PackageFile .INDENT 7.0 .TP .B __init__(filename: \fI\%str\fP, comment: \fI\%str\fP | \fI\%None\fP, metadata: Distribution, python_version: \fI\%str\fP | \fI\%None\fP, filetype: \fI\%str\fP | \fI\%None\fP) -> \fI\%None\fP .UNINDENT .INDENT 7.0 .TP .B classmethod from_filename(filename: \fI\%str\fP, comment: \fI\%str\fP | \fI\%None\fP) -> \fI\%PackageFile\fP .UNINDENT .INDENT 7.0 .TP .B metadata_dictionary() -> \fI\%Dict\fP[\fI\%str\fP, \fI\%str\fP | \fI\%None\fP | \fI\%Sequence\fP[\fI\%str\fP] | \fI\%Tuple\fP[\fI\%str\fP, \fI\%bytes\fP]] Merge multiple sources of metadata into a single dictionary. .sp Includes values from filename, PKG\-INFO, hashers, and signature. .UNINDENT .INDENT 7.0 .TP .B add_gpg_signature(signature_filepath: \fI\%str\fP, signature_filename: \fI\%str\fP) -> \fI\%None\fP .UNINDENT .INDENT 7.0 .TP .B sign(sign_with: \fI\%str\fP, identity: \fI\%str\fP | \fI\%None\fP) -> \fI\%None\fP .UNINDENT .INDENT 7.0 .TP .B classmethod run_gpg(gpg_args: \fI\%Tuple\fP[\fI\%str\fP, \&...]) -> \fI\%None\fP .UNINDENT .UNINDENT .INDENT 0.0 .TP .B class twine.package.Hexdigest Hexdigest(md5, sha2, blake2) .INDENT 7.0 .TP .B md5: \fI\%str\fP | \fI\%None\fP Alias for field number 0 .UNINDENT .INDENT 7.0 .TP .B sha2: \fI\%str\fP | \fI\%None\fP Alias for field number 1 .UNINDENT .INDENT 7.0 .TP .B blake2: \fI\%str\fP | \fI\%None\fP Alias for field number 2 .UNINDENT .INDENT 7.0 .TP .B static __new__(_cls, md5: \fI\%str\fP | \fI\%None\fP, sha2: \fI\%str\fP | \fI\%None\fP, blake2: \fI\%str\fP | \fI\%None\fP) Create new instance of Hexdigest(md5, sha2, blake2) .UNINDENT .INDENT 7.0 .TP .B _asdict() Return a new dict which maps field names to their values. .UNINDENT .INDENT 7.0 .TP .B _field_defaults = {} .UNINDENT .INDENT 7.0 .TP .B _fields = (\(aqmd5\(aq, \(aqsha2\(aq, \(aqblake2\(aq) .UNINDENT .INDENT 7.0 .TP .B classmethod _make(iterable) Make a new Hexdigest object from a sequence or iterable .UNINDENT .INDENT 7.0 .TP .B _replace(**kwds) Return a new Hexdigest object replacing specified fields with new values .UNINDENT .UNINDENT .INDENT 0.0 .TP .B class twine.package.HashManager Manage our hashing objects for simplicity. .sp This will also allow us to better test this logic. .INDENT 7.0 .TP .B __init__(filename: \fI\%str\fP) -> \fI\%None\fP Initialize our manager and hasher objects. .UNINDENT .INDENT 7.0 .TP .B _md5_update(content: \fI\%bytes\fP) -> \fI\%None\fP .UNINDENT .INDENT 7.0 .TP .B _md5_hexdigest() -> \fI\%str\fP | \fI\%None\fP .UNINDENT .INDENT 7.0 .TP .B _sha2_update(content: \fI\%bytes\fP) -> \fI\%None\fP .UNINDENT .INDENT 7.0 .TP .B _sha2_hexdigest() -> \fI\%str\fP | \fI\%None\fP .UNINDENT .INDENT 7.0 .TP .B _blake_update(content: \fI\%bytes\fP) -> \fI\%None\fP .UNINDENT .INDENT 7.0 .TP .B _blake_hexdigest() -> \fI\%str\fP | \fI\%None\fP .UNINDENT .INDENT 7.0 .TP .B hash() -> \fI\%None\fP Hash the file contents. .UNINDENT .INDENT 7.0 .TP .B hexdigest() -> \fI\%Hexdigest\fP Return the hexdigest for the file. .UNINDENT .UNINDENT .SS twine.repository module .INDENT 0.0 .TP .B class twine.repository.Repository .INDENT 7.0 .TP .B __init__(repository_url: \fI\%str\fP, username: \fI\%str\fP | \fI\%None\fP, password: \fI\%str\fP | \fI\%None\fP, disable_progress_bar: \fI\%bool\fP = False) -> \fI\%None\fP .UNINDENT .INDENT 7.0 .TP .B static _make_adapter_with_retries() -> \fI\%HTTPAdapter\fP .UNINDENT .INDENT 7.0 .TP .B static _make_user_agent_string() -> \fI\%str\fP .UNINDENT .INDENT 7.0 .TP .B close() -> \fI\%None\fP .UNINDENT .INDENT 7.0 .TP .B static _convert_data_to_list_of_tuples(data: \fI\%Dict\fP[\fI\%str\fP, \fI\%Any\fP]) -> \fI\%List\fP[\fI\%Tuple\fP[\fI\%str\fP, \fI\%Any\fP]] .UNINDENT .INDENT 7.0 .TP .B set_certificate_authority(cacert: \fI\%str\fP | \fI\%None\fP) -> \fI\%None\fP .UNINDENT .INDENT 7.0 .TP .B set_client_certificate(clientcert: \fI\%str\fP | \fI\%None\fP) -> \fI\%None\fP .UNINDENT .INDENT 7.0 .TP .B register(package: \fI\%PackageFile\fP) -> \fI\%Response\fP .UNINDENT .INDENT 7.0 .TP .B _upload(package: \fI\%PackageFile\fP) -> \fI\%Response\fP .UNINDENT .INDENT 7.0 .TP .B upload(package: \fI\%PackageFile\fP, max_redirects: \fI\%int\fP = 5) -> \fI\%Response\fP .UNINDENT .INDENT 7.0 .TP .B package_is_uploaded(package: \fI\%PackageFile\fP, bypass_cache: \fI\%bool\fP = False) -> \fI\%bool\fP .UNINDENT .INDENT 7.0 .TP .B release_urls(packages: \fI\%List\fP[\fI\%PackageFile\fP]) -> \fI\%Set\fP[\fI\%str\fP] .UNINDENT .INDENT 7.0 .TP .B verify_package_integrity(package: \fI\%PackageFile\fP) -> \fI\%None\fP .UNINDENT .UNINDENT .SS twine.settings module .sp Module containing logic for handling settings. .INDENT 0.0 .TP .B class twine.settings.Settings Object that manages the configuration for Twine. .sp This object can only be instantiated with keyword arguments. .sp For example, .INDENT 7.0 .INDENT 3.5 .sp .EX Settings(True, username=\(aqfakeusername\(aq) .EE .UNINDENT .UNINDENT .sp Will raise a \fI\%TypeError\fP\&. Instead, you would want .INDENT 7.0 .INDENT 3.5 .sp .EX Settings(sign=True, username=\(aqfakeusername\(aq) .EE .UNINDENT .UNINDENT .INDENT 7.0 .TP .B __init__(*, sign: \fI\%bool\fP = False, sign_with: \fI\%str\fP = \(aqgpg\(aq, identity: \fI\%str\fP | \fI\%None\fP = None, username: \fI\%str\fP | \fI\%None\fP = None, password: \fI\%str\fP | \fI\%None\fP = None, non_interactive: \fI\%bool\fP = False, comment: \fI\%str\fP | \fI\%None\fP = None, config_file: \fI\%str\fP = utils.DEFAULT_CONFIG_FILE, skip_existing: \fI\%bool\fP = False, cacert: \fI\%str\fP | \fI\%None\fP = None, client_cert: \fI\%str\fP | \fI\%None\fP = None, repository_name: \fI\%str\fP = \(aqpypi\(aq, repository_url: \fI\%str\fP | \fI\%None\fP = None, verbose: \fI\%bool\fP = False, disable_progress_bar: \fI\%bool\fP = False, **ignored_kwargs: \fI\%Any\fP) -> \fI\%None\fP Initialize our settings instance. .INDENT 7.0 .TP .B Parameters .INDENT 7.0 .IP \(bu 2 \fBsign\fP \-\- Configure whether the package file should be signed. .IP \(bu 2 \fBsign_with\fP \-\- The name of the executable used to sign the package with. .IP \(bu 2 \fBidentity\fP \-\- The GPG identity that should be used to sign the package file. .IP \(bu 2 \fBusername\fP \-\- The username used to authenticate to the repository (package index). .IP \(bu 2 \fBpassword\fP \-\- The password used to authenticate to the repository (package index). .IP \(bu 2 \fBnon_interactive\fP \-\- Do not interactively prompt for username/password if the required credentials are missing. .IP \(bu 2 \fBcomment\fP \-\- The comment to include with each distribution file. .IP \(bu 2 \fBconfig_file\fP \-\- The path to the configuration file to use. .IP \(bu 2 \fBskip_existing\fP \-\- Specify whether twine should continue uploading files if one of them already exists. This primarily supports PyPI. Other package indexes may not be supported. .IP \(bu 2 \fBcacert\fP \-\- The path to the bundle of certificates used to verify the TLS connection to the package index. .IP \(bu 2 \fBclient_cert\fP \-\- The path to the client certificate used to perform authentication to the index. This must be a single file that contains both the private key and the PEM\-encoded certificate. .IP \(bu 2 \fBrepository_name\fP \-\- The name of the repository (package index) to interact with. This should correspond to a section in the config file. .IP \(bu 2 \fBrepository_url\fP \-\- The URL of the repository (package index) to interact with. This will override the settings inferred from \fBrepository_name\fP\&. .IP \(bu 2 \fBverbose\fP \-\- Show verbose output. .IP \(bu 2 \fBdisable_progress_bar\fP \-\- Disable the progress bar. .UNINDENT .UNINDENT .UNINDENT .INDENT 7.0 .TP .B property username: \fI\%str\fP | \fI\%None\fP .UNINDENT .INDENT 7.0 .TP .B property password: \fI\%str\fP | \fI\%None\fP .UNINDENT .INDENT 7.0 .TP .B _allow_noninteractive() -> \fI\%AbstractContextManager\fP[\fI\%None\fP] Bypass NonInteractive error when client cert is present. .UNINDENT .INDENT 7.0 .TP .B property verbose: \fI\%bool\fP .UNINDENT .INDENT 7.0 .TP .B static register_argparse_arguments(parser: \fI\%ArgumentParser\fP) -> \fI\%None\fP Register the arguments for argparse. .UNINDENT .INDENT 7.0 .TP .B classmethod from_argparse(args: \fI\%Namespace\fP) -> \fI\%Settings\fP Generate the Settings from parsed arguments. .UNINDENT .INDENT 7.0 .TP .B _handle_package_signing(sign: \fI\%bool\fP, sign_with: \fI\%str\fP, identity: \fI\%str\fP | \fI\%None\fP) -> \fI\%None\fP .UNINDENT .INDENT 7.0 .TP .B _handle_repository_options(repository_name: \fI\%str\fP, repository_url: \fI\%str\fP | \fI\%None\fP) -> \fI\%None\fP .UNINDENT .INDENT 7.0 .TP .B _handle_certificates(cacert: \fI\%str\fP | \fI\%None\fP, client_cert: \fI\%str\fP | \fI\%None\fP) -> \fI\%None\fP .UNINDENT .INDENT 7.0 .TP .B check_repository_url() -> \fI\%None\fP Verify we are not using legacy PyPI. .INDENT 7.0 .TP .B Raises \fI\%twine.exceptions.UploadToDeprecatedPyPIDetected\fP \-\- The configured repository URL is for legacy PyPI. .UNINDENT .UNINDENT .INDENT 7.0 .TP .B create_repository() -> \fI\%Repository\fP Create a new repository for uploading. .UNINDENT .UNINDENT .SS twine.utils module .INDENT 0.0 .TP .B twine.utils.get_config(path: \fI\%str\fP) -> \fI\%Dict\fP[\fI\%str\fP, \fI\%Dict\fP[\fI\%str\fP, \fI\%str\fP | \fI\%None\fP]] Read repository configuration from a file (i.e. ~/.pypirc). .sp Format: \fI\%https://packaging.python.org/specifications/pypirc/\fP .sp If the default config file doesn\(aqt exist, return a default configuration for pypyi and testpypi. .UNINDENT .INDENT 0.0 .TP .B twine.utils._validate_repository_url(repository_url: \fI\%str\fP) -> \fI\%None\fP Validate the given url for allowed schemes and components. .UNINDENT .INDENT 0.0 .TP .B twine.utils.get_repository_from_config(config_file: \fI\%str\fP, repository: \fI\%str\fP, repository_url: \fI\%str\fP | \fI\%None\fP = None) -> \fI\%Dict\fP[\fI\%str\fP, \fI\%str\fP | \fI\%None\fP] Get repository config command\-line values or the .pypirc file. .UNINDENT .INDENT 0.0 .TP .B twine.utils.normalize_repository_url(url: \fI\%str\fP) -> \fI\%str\fP .UNINDENT .INDENT 0.0 .TP .B twine.utils.get_file_size(filename: \fI\%str\fP) -> \fI\%str\fP Return the size of a file in KB, or MB if >= 1024 KB. .UNINDENT .INDENT 0.0 .TP .B twine.utils.check_status_code(response: \fI\%Response\fP, verbose: \fI\%bool\fP) -> \fI\%None\fP Generate a helpful message based on the response from the repository. .sp Raise a custom exception for recognized errors. Otherwise, print the response content (based on the verbose option) before re\-raising the HTTPError. .UNINDENT .INDENT 0.0 .TP .B twine.utils.get_userpass_value(cli_value: \fI\%str\fP | \fI\%None\fP, config: \fI\%Dict\fP[\fI\%str\fP, \fI\%str\fP | \fI\%None\fP], key: \fI\%str\fP, prompt_strategy: \fI\%Callable\fP[[], \fI\%str\fP] | \fI\%None\fP = None) -> \fI\%str\fP | \fI\%None\fP Get a credential (e.g. a username or password) from the configuration. .sp Uses the following rules: .INDENT 7.0 .IP 1. 3 If \fBcli_value\fP is specified, use that. .IP 2. 3 If \fBconfig[key]\fP is specified, use that. .IP 3. 3 If \fBprompt_strategy\fP is specified, use its return value. .IP 4. 3 Otherwise return \fBNone\fP .UNINDENT .INDENT 7.0 .TP .B Parameters .INDENT 7.0 .IP \(bu 2 \fBcli_value\fP \-\- The value supplied from the command line. .IP \(bu 2 \fBconfig\fP \-\- A dictionary of repository configuration values. .IP \(bu 2 \fBkey\fP \-\- The credential to look up in \fBconfig\fP, e.g. \fB\(dqusername\(dq\fP or \fB\(dqpassword\(dq\fP\&. .IP \(bu 2 \fBprompt_strategy\fP \-\- An argumentless function to get the value, e.g. from keyring or by prompting the user. .UNINDENT .TP .B Returns The credential value, i.e. the username or password. .UNINDENT .UNINDENT .INDENT 0.0 .TP .B twine.utils.get_cacert(cli_value: \fI\%str\fP | \fI\%None\fP, config: \fI\%Dict\fP[\fI\%str\fP, \fI\%str\fP | \fI\%None\fP], *, key: \fI\%str\fP = \(aqca_cert\(aq, prompt_strategy: \fI\%Callable\fP[[], \fI\%str\fP] | \fI\%None\fP = None) -> \fI\%str\fP | \fI\%None\fP Get the CA bundle via \fI\%get_userpass_value()\fP\&. .UNINDENT .INDENT 0.0 .TP .B twine.utils.get_clientcert(cli_value: \fI\%str\fP | \fI\%None\fP, config: \fI\%Dict\fP[\fI\%str\fP, \fI\%str\fP | \fI\%None\fP], *, key: \fI\%str\fP = \(aqclient_cert\(aq, prompt_strategy: \fI\%Callable\fP[[], \fI\%str\fP] | \fI\%None\fP = None) -> \fI\%str\fP | \fI\%None\fP Get the client certificate via \fI\%get_userpass_value()\fP\&. .UNINDENT .INDENT 0.0 .TP .B class twine.utils.EnvironmentDefault Get values from environment variable. .INDENT 7.0 .TP .B __init__(env: \fI\%str\fP, required: \fI\%bool\fP = True, default: \fI\%str\fP | \fI\%None\fP = None, **kwargs: \fI\%Any\fP) -> \fI\%None\fP .UNINDENT .UNINDENT .INDENT 0.0 .TP .B class twine.utils.EnvironmentFlag Set boolean flag from environment variable. .INDENT 7.0 .TP .B __init__(env: \fI\%str\fP, **kwargs: \fI\%Any\fP) -> \fI\%None\fP .UNINDENT .INDENT 7.0 .TP .B static bool_from_env(val: \fI\%str\fP | \fI\%None\fP) -> \fI\%bool\fP Allow \(aq0\(aq and \(aqfalse\(aq and \(aqno\(aq to be False. .UNINDENT .UNINDENT .SS twine.wheel module .INDENT 0.0 .TP .B class twine.wheel.Wheel .INDENT 7.0 .TP .B __init__(filename: \fI\%str\fP, metadata_version: \fI\%str\fP | \fI\%None\fP = None) -> \fI\%None\fP .UNINDENT .INDENT 7.0 .TP .B property py_version: \fI\%str\fP .UNINDENT .INDENT 7.0 .TP .B static find_candidate_metadata_files(names: \fI\%List\fP[\fI\%str\fP]) -> \fI\%List\fP[\fI\%List\fP[\fI\%str\fP]] Filter files that may be METADATA files. .UNINDENT .INDENT 7.0 .TP .B read() -> \fI\%bytes\fP .UNINDENT .INDENT 7.0 .TP .B parse(data: \fI\%bytes\fP) -> \fI\%None\fP .UNINDENT .UNINDENT .SS twine.wininst module .INDENT 0.0 .TP .B class twine.wininst.WinInst .INDENT 7.0 .TP .B __init__(filename: \fI\%str\fP, metadata_version: \fI\%str\fP | \fI\%None\fP = None) -> \fI\%None\fP .UNINDENT .INDENT 7.0 .TP .B property py_version: \fI\%str\fP .UNINDENT .INDENT 7.0 .TP .B read() -> \fI\%bytes\fP .UNINDENT .UNINDENT .SS Where Twine gets configuration and credentials .sp A user can set the repository URL, username, and/or password via command line, \fB\&.pypirc\fP files, environment variables, and \fBkeyring\fP\&. .SH ADDING A MAINTAINER .sp A checklist for adding a new maintainer to the project. .INDENT 0.0 .IP 1. 3 Add them as a Member in the GitHub repo settings. .IP 2. 3 Get them Test PyPI and canon PyPI usernames and add them as a Maintainer on \fI\%our Test PyPI project\fP and \fI\%canon PyPI\fP\&. .UNINDENT .SH MAKING A NEW RELEASE .sp A checklist for creating, testing, and distributing a new version. .INDENT 0.0 .IP 1. 3 Choose a version number, and create a new branch .INDENT 3.0 .INDENT 3.5 .sp .EX VERSION=3.4.2 git switch \-c release\-$VERSION .EE .UNINDENT .UNINDENT .IP 2. 3 Update \fBdocs/changelog.rst\fP .INDENT 3.0 .INDENT 3.5 .sp .EX tox \-e changelog \-\- \-\-version $VERSION git commit \-am \(dqUpdate changelog for $VERSION\(dq .EE .UNINDENT .UNINDENT .IP 3. 3 Open a pull request for review .IP 4. 3 Merge the pull request, and ensure the \fI\%GitHub Actions\fP build passes .IP 5. 3 Create a new git tag for the version .INDENT 3.0 .INDENT 3.5 .sp .EX git switch main git pull \-\-ff\-only upstream main git tag \-m \(dqRelease v$VERSION\(dq $VERSION .EE .UNINDENT .UNINDENT .IP 6. 3 Push to start the release, and watch it in \fI\%GitHub Actions\fP .INDENT 3.0 .INDENT 3.5 .sp .EX git push upstream $VERSION .EE .UNINDENT .UNINDENT .IP 7. 3 View the new release on \fI\%PyPI\fP .UNINDENT .SH FUTURE DEVELOPMENT .sp See our \fI\%open issues\fP\&. .sp In the future, \fBpip\fP and \fBtwine\fP may merge into a single tool; see \fI\%ongoing discussion\fP\&. .sp Twine is a utility for \fI\%publishing\fP Python packages to \fI\%PyPI\fP and other \fI\%repositories\fP\&. It provides build system independent uploads of source and binary \fI\%distribution artifacts\fP for both new and existing \fI\%projects\fP\&. .SH WHY SHOULD I USE THIS? .sp The goal of Twine is to improve PyPI interaction by improving security and testability. .sp The biggest reason to use Twine is that it securely authenticates you to PyPI over HTTPS using a verified connection, regardless of the underlying Python version. Meanwhile, \fBpython setup.py upload\fP will only work correctly and securely if your build system, Python version, and underlying operating system are configured properly. .sp Secondly, Twine encourages you to build your distribution files. \fBpython setup.py upload\fP only allows you to upload a package as a final step after building with \fBdistutils\fP or \fBsetuptools\fP, within the same command invocation. This means that you cannot test the exact file you\(aqre going to upload to PyPI to ensure that it works before uploading it. .sp Finally, Twine allows you to pre\-sign your files and pass the \fB\&.asc\fP files into the command line invocation (\fBtwine upload myproject\-1.0.1.tar.gz myproject\-1.0.1.tar.gz.asc\fP). This enables you to be assured that you\(aqre typing your \fBgpg\fP passphrase into \fBgpg\fP itself and not anything else, since \fIyou\fP will be the one directly executing \fBgpg \-\-detach\-sign \-a \fP\&. .SH FEATURES .INDENT 0.0 .IP \(bu 2 Verified HTTPS connections .IP \(bu 2 Uploading doesn\(aqt require executing \fBsetup.py\fP .IP \(bu 2 Uploading files that have already been created, allowing testing of distributions before release .IP \(bu 2 Supports uploading any packaging format (including \fI\%wheels\fP) .UNINDENT .SH INSTALLATION .INDENT 0.0 .INDENT 3.5 .sp .EX pip install twine .EE .UNINDENT .UNINDENT .SH USING TWINE .INDENT 0.0 .IP 1. 3 Create some distributions in the normal way: .INDENT 3.0 .INDENT 3.5 .sp .EX python \-m build .EE .UNINDENT .UNINDENT .IP 2. 3 Upload to \fI\%Test PyPI\fP and verify things look right: .INDENT 3.0 .INDENT 3.5 .sp .EX twine upload \-r testpypi dist/* .EE .UNINDENT .UNINDENT .sp Twine will prompt for your username and password. .IP 3. 3 Upload to \fI\%PyPI\fP: .INDENT 3.0 .INDENT 3.5 .sp .EX twine upload dist/* .EE .UNINDENT .UNINDENT .IP 4. 3 Done! .UNINDENT .sp \fBNOTE:\fP .INDENT 0.0 .INDENT 3.5 Like many other command line tools, Twine does not show any characters when you enter your password. .sp If you\(aqre using Windows and trying to paste your username, password, or token in the Command Prompt or PowerShell, \fBCtrl\-V\fP and \fBShift+Insert\fP won\(aqt work. Instead, you can use \(dqEdit > Paste\(dq from the window menu, or enable \(dqUse Ctrl+Shift+C/V as Copy/Paste\(dq in \(dqProperties\(dq. This is a \fI\%known issue\fP with Python\(aqs \fBgetpass\fP module. .UNINDENT .UNINDENT .sp More documentation on using Twine to upload packages to PyPI is in the \fI\%Python Packaging User Guide\fP\&. .SH COMMANDS .SS \fBtwine upload\fP .sp Uploads one or more distributions to a repository. .INDENT 0.0 .INDENT 3.5 .sp .EX usage: twine upload [\-h] [\-r REPOSITORY] [\-\-repository\-url REPOSITORY_URL] [\-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). Usually dist/* . May additionally contain a .asc file 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 via TWINE_REPOSITORY environment variable.) \-\-repository\-url REPOSITORY_URL The repository (package index) URL to upload the package to. This overrides \-\-repository. (Can also be set via TWINE_REPOSITORY_URL environment variable.) \-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 via TWINE_USERNAME environment variable.) \-p PASSWORD, \-\-password PASSWORD The password to authenticate to the repository (package index) with. (Can also be set via TWINE_PASSWORD environment variable.) \-\-non\-interactive Do not interactively prompt for username/password if the required credentials are missing. (Can also be set via TWINE_NON_INTERACTIVE environment variable.) \-c COMMENT, \-\-comment COMMENT The comment to include with the distribution file. \-\-config\-file CONFIG_FILE The .pypirc config 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 via TWINE_CERT environment 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. .EE .UNINDENT .UNINDENT .SS \fBtwine check\fP .sp Checks whether your distribution\(aqs long description will render correctly on PyPI. .INDENT 0.0 .INDENT 3.5 .sp .EX usage: twine check [\-h] [\-\-strict] dist [dist ...] positional arguments: dist The distribution files to check, usually dist/* options: \-h, \-\-help show this help message and exit \-\-strict Fail on warnings .EE .UNINDENT .UNINDENT .SS \fBtwine register\fP .sp Pre\-register a name with a repository before uploading a distribution. .sp \fBWARNING:\fP .INDENT 0.0 .INDENT 3.5 Pre\-registration is \fI\%not supported on PyPI\fP, so the \fBregister\fP command is only necessary if you are using a different repository that requires it. See \fI\%issue #1627 on Warehouse\fP (the software running on PyPI) for more details. .UNINDENT .UNINDENT .INDENT 0.0 .INDENT 3.5 .sp .EX usage: twine register [\-h] [\-r REPOSITORY] [\-\-repository\-url REPOSITORY_URL] [\-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 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 via TWINE_REPOSITORY environment variable.) \-\-repository\-url REPOSITORY_URL The repository (package index) URL to upload the package to. This overrides \-\-repository. (Can also be set via TWINE_REPOSITORY_URL environment variable.) \-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 via TWINE_USERNAME environment variable.) \-p PASSWORD, \-\-password PASSWORD The password to authenticate to the repository (package index) with. (Can also be set via TWINE_PASSWORD environment variable.) \-\-non\-interactive Do not interactively prompt for username/password if the required credentials are missing. (Can also be set via TWINE_NON_INTERACTIVE environment variable.) \-c COMMENT, \-\-comment COMMENT The comment to include with the distribution file. \-\-config\-file CONFIG_FILE The .pypirc config 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 via TWINE_CERT environment 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. .EE .UNINDENT .UNINDENT .SH CONFIGURATION .sp Twine can read repository configuration from a \fB\&.pypirc\fP file, either in your home directory, or provided with the \fB\-\-config\-file\fP option. For details on writing and using \fB\&.pypirc\fP, see the \fI\%specification\fP in the Python Packaging User Guide. .SS Environment Variables .sp Twine also supports configuration via environment variables. Options passed on the command line will take precedence over options set via environment variables. Definition via environment variable is helpful in environments where it is not convenient to create a \fB\&.pypirc\fP file (for example, on a CI/build server). .INDENT 0.0 .IP \(bu 2 \fBTWINE_USERNAME\fP \- the username to use for authentication to the repository. .IP \(bu 2 \fBTWINE_PASSWORD\fP \- the password to use for authentication to the repository. .IP \(bu 2 \fBTWINE_REPOSITORY\fP \- the repository configuration, either defined as a section in \fB\&.pypirc\fP or provided as a full URL. .IP \(bu 2 \fBTWINE_REPOSITORY_URL\fP \- the repository URL to use. .IP \(bu 2 \fBTWINE_CERT\fP \- custom CA certificate to use for repositories with self\-signed or untrusted certificates. .IP \(bu 2 \fBTWINE_NON_INTERACTIVE\fP \- Do not interactively prompt for username/password if the required credentials are missing. .UNINDENT .SS Proxy Support .sp Twine can be configured to use a proxy by setting environment variables. For example, to use a proxy for just the \fBtwine\fP command, without \fBexport\fP\-ing it for other tools: .INDENT 0.0 .INDENT 3.5 .sp .EX HTTPS_PROXY=socks5://user:pass@host:port twine upload dist/* .EE .UNINDENT .UNINDENT .sp For more information, see the Requests documentation on \fI\%Proxies\fP and requests:socks, and \fI\%an in\-depth article about proxy environment variables\fP\&. .SH KEYRING SUPPORT .sp Instead of typing in your password every time you upload a distribution, Twine allows storing a username and password securely using \fI\%keyring\fP\&. Keyring is installed with Twine but for some systems (Linux mainly) may require \fI\%additional installation steps\fP\&. .sp Once Twine is installed, use the \fBkeyring\fP program to set a username and password to use for each repository to which you may upload. .sp For example, to set a username and password for PyPI: .INDENT 0.0 .INDENT 3.5 .sp .EX keyring set https://upload.pypi.org/legacy/ your\-username .EE .UNINDENT .UNINDENT .sp and enter the password when prompted. .sp For a different repository, replace the URL with the relevant repository URL. For example, for Test PyPI, use \fBhttps://test.pypi.org/legacy/\fP\&. .sp The next time you run \fBtwine\fP, it will prompt you for a username, and then get the appropriate password from Keyring. .sp \fBNOTE:\fP .INDENT 0.0 .INDENT 3.5 If you are using Linux in a headless environment (such as on a server) you\(aqll need to do some additional steps to ensure that Keyring can store secrets securely. See \fI\%Using Keyring on headless systems\fP\&. .UNINDENT .UNINDENT .SS Disabling Keyring .sp In most cases, simply not setting a password with \fBkeyring\fP will allow Twine to fall back to prompting for a password. In some cases, the presence of Keyring will cause unexpected or undesirable prompts from the backing system. In these cases, it may be desirable to disable Keyring altogether. To disable Keyring, run: .INDENT 0.0 .INDENT 3.5 .sp .EX keyring \-\-disable .EE .UNINDENT .UNINDENT .sp See \fI\%Twine issue #338\fP for discussion and background. .SH AUTHOR Donald Stufft, Individual contributors .SH COPYRIGHT 2024, Donald Stufft and individual contributors .\" Generated by docutils manpage writer. .