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

Update and add links to .pypirc specification #655

Merged
merged 2 commits into from Jun 6, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
11 changes: 10 additions & 1 deletion README.rst
Expand Up @@ -21,7 +21,7 @@ twine
Twine is `a utility`_ for `publishing`_ Python packages on `PyPI`_.

It provides build system independent uploads of source and binary
`distribution artifacts <distributions>`_ for both new and existing
`distribution artifact <distributions_>`_ for both new and existing
`projects`_.


Expand Down Expand Up @@ -306,6 +306,14 @@ For completeness, its usage:
containing the private key and the certificate in PEM
format.

Configuration File
^^^^^^^^^^^^^^^^^^

Twine can read repository configuration from a ``.pypirc`` file, either in your
home directory, or provided with the ``--config-file`` option. For details on
writing and using ``.pypirc``, see the `specification <pypirc_>`_ in the Python
Packaging User Guide.

Environment Variables
^^^^^^^^^^^^^^^^^^^^^

Expand Down Expand Up @@ -351,6 +359,7 @@ trackers, chat rooms, and mailing lists is expected to follow the
.. _`publishing`: https://packaging.python.org/tutorials/distributing-packages/
.. _`PyPI`: https://pypi.org
.. _`Test PyPI`: https://packaging.python.org/guides/using-testpypi/
.. _`pypirc`: https://packaging.python.org/specifications/pypirc/
.. _`Python Packaging User Guide`:
https://packaging.python.org/tutorials/distributing-packages/
.. _`keyring`: https://pypi.org/project/keyring/
Expand Down
4 changes: 2 additions & 2 deletions twine/utils.py
Expand Up @@ -66,7 +66,7 @@ def get_config(path: str = "~/.pypirc") -> Dict[str, RepositoryConfig]:
parser.read(path)

# Get a list of index_servers from the config file
# format: https://docs.python.org/3/distutils/packageindex.html#pypirc
# format: https://packaging.python.org/specifications/pypirc/
if parser.has_option("distutils", "index-servers"):
index_servers = parser.get("distutils", "index-servers").split()

Expand Down Expand Up @@ -139,7 +139,7 @@ def get_repository_from_config(
"or not a complete URL in --repository-url.\n"
"Maybe you have an out-dated '{cfg}' format?\n"
"more info: "
"https://docs.python.org/distutils/packageindex.html#pypirc\n"
"https://packaging.python.org/specifications/pypirc/\n"
).format(repo=repository, cfg=config_file)
raise exceptions.InvalidConfiguration(msg)

Expand Down