Skip to content
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

Add .pypirc section to the README #340

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 41 additions & 0 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,46 @@ Using Twine
More documentation on using ``twine`` to upload packages to PyPI is in
the `Python Packaging User Guide`_.

Configuring ``.pypirc``
-----------------------

Creating a ``$HOME/.pypirc`` file allows you to define the
repositories you use, avoiding entering URLs, usernames and passwords
whenever you run Twine::

[distutils]
index-servers =
pypi
testpypi

[pypi]
repository: https://upload.pypi.org/legacy/
username: <username>

[testpypi]
repository: https://test.pypi.org/legacy/
username: <username>
password: <password>

You may create as many sections as you want, but remember to add their
names to the ``index-servers`` variable in the ``distutils`` section.
The next time you run ``twine``, you just need to use the
``--repository`` option:

.. code-block:: console

$ twine upload --repository testpypi dist/*

.. warning::
Including your password to this file is discouraged, as
**it will be stored in plaintext**. It is recommended to ommit the
password as it was done for the ``pypi`` section of the file and
either provide it whenever you run Twine or configure the
``keyring`` program, explained in the following section.

More information about the ``.pypirc`` file can be found in the
`Python Standard Library`_.

Keyring Support
---------------

Expand Down Expand Up @@ -293,6 +333,7 @@ trackers, chat rooms, and mailing lists is expected to follow the
.. _`PyPI`: https://pypi.org
.. _`Test PyPI`: https://packaging.python.org/guides/using-testpypi/
.. _`Python Packaging User Guide`: https://packaging.python.org/tutorials/distributing-packages/
.. _`Python Standard Library`: https://docs.python.org/3/distutils/packageindex.html#the-pypirc-file
.. _`documentation`: https://twine.readthedocs.io/
.. _`developer documentation`: https://twine.readthedocs.io/en/latest/contributing.html
.. _`projects`: https://packaging.python.org/glossary/#term-project
Expand Down