-
Notifications
You must be signed in to change notification settings - Fork 315
Add instructions on how to use keyring #323
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -55,20 +55,23 @@ Installation | |
$ pip install twine | ||
|
||
|
||
Usage | ||
----- | ||
Using Twine | ||
----------- | ||
|
||
1. Create some distributions in the normal way: | ||
|
||
.. code-block:: console | ||
|
||
$ python setup.py sdist bdist_wheel | ||
|
||
2. Upload with ``twine`` to `Test PyPI`_ and verify things look right: | ||
2. Upload with ``twine`` to `Test PyPI`_ and verify things look right. Twine will automatically prompt for your username and password: | ||
|
||
.. code-block:: console | ||
|
||
$ twine upload --repository-url https://test.pypi.org/legacy/ dist/* | ||
username: ... | ||
password: | ||
... | ||
|
||
3. Upload to `PyPI`_: | ||
|
||
|
@@ -81,9 +84,58 @@ Usage | |
More documentation on using ``twine`` to upload packages to PyPI is in | ||
the `Python Packaging User Guide`_. | ||
|
||
Keyring Support | ||
--------------- | ||
|
||
Instead of typing in your password every time you upload a distribution, Twine | ||
allows you to store your username and password securely using `keyring`_. | ||
|
||
To use the keyring, you must first install the keyring packages: | ||
|
||
- On Windows and MacOS you just need to install ``keyring``, for example, | ||
``pip install --user keyring``. | ||
- On Linux, in addition to the ``keyring`` package you also need to ensure the | ||
``python3-dbus`` system package is installed. For example, ``apt install | ||
python3-dbus``. See `Keyring's installation instructions`_ for more details. | ||
|
||
Once keyring is installed you can use the ``keyring`` program to set your | ||
username and password to use for each package index (repository) you want to | ||
upload to using Twine. | ||
|
||
To set your username and password for test PyPI run the following command. | ||
``keyring`` will prompt you for your password: | ||
|
||
.. code-block:: console | ||
|
||
$ keyring set https://test.pypi.org/legacy/ your-username | ||
# or | ||
$ python3 -m keyring set https://test.pypi.org/legacy/ your-username | ||
|
||
To set your username and password for PyPI run this command, again, ``keyring`` | ||
will prompt for the password: | ||
|
||
.. code-block:: console | ||
|
||
$ keyring set https://upload.pypi.org/legacy/ your-username | ||
# or | ||
$ python3 -m keyring set https://upload.pypi.org/legacy/ your-username | ||
|
||
|
||
The next time you run ``twine`` it will prompt you for a username and will grab the appropriate password from the keyring. | ||
|
||
.. Note:: If you are using Linux in a headless environment (such as on a | ||
server) you'll need to do some additional steps to ensure that Keyring can | ||
store secrets securely. See `Using Keyring on headless systems`_. | ||
|
||
.. _`keyring`: https://pypi.org/project/keyring/ | ||
.. _`Keyring's installation instructions`: | ||
https://keyring.readthedocs.io/en/latest#installation-instructions | ||
.. _`Using Keyring on headless systems`: | ||
https://keyring.readthedocs.io/en/latest/#using-keyring-on-headless-linux-systems | ||
|
||
|
||
Options | ||
^^^^^^^ | ||
------- | ||
|
||
.. code-block:: console | ||
|
||
|
@@ -205,13 +257,13 @@ variables. Definition via environment variable is helpful in environments where | |
it is not convenient to create a `.pypirc` file, such as a CI/build server, for | ||
example. | ||
|
||
* ``TWINE_USERNAME`` - the username to use for authentication to the repository | ||
* ``TWINE_PASSWORD`` - the password to use for authentication to the repository | ||
* ``TWINE_USERNAME`` - the username to use for authentication to the repository. | ||
* ``TWINE_PASSWORD`` - the password to use for authentication to the repository. | ||
* ``TWINE_REPOSITORY`` - the repository configuration, either defined as a | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. For parallelism, could you add the ending period to all the items in this list? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Done. |
||
section in `.pypirc` or provided as a full URL | ||
* ``TWINE_REPOSITORY_URL`` - the repository URL to use | ||
section in `.pypirc` or provided as a full URL. | ||
* ``TWINE_REPOSITORY_URL`` - the repository URL to use. | ||
* ``TWINE_CERT`` - custom CA certificate to use for repositories with | ||
self-signed or untrusted certificates | ||
self-signed or untrusted certificates. | ||
|
||
Resources | ||
--------- | ||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you find some way here to indicate that it'll ask you to input a password? And I have the same suggestion for line 116-117.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.