Skip to content

Commit

Permalink
Merge pull request #721 from bhrutledge/repository-defaults
Browse files Browse the repository at this point in the history
Replace repo URLs with defaults
  • Loading branch information
di committed Apr 21, 2020
2 parents abce5a7 + 84158ab commit 4c8a6ed
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 23 deletions.
26 changes: 5 additions & 21 deletions source/guides/using-testpypi.rst
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,12 @@ https://test.pypi.org/account/register/ to register your account.
Using TestPyPI with Twine
-------------------------

You can upload your distributions to TestPyPI using :ref:`twine` by passing
in the ``--repository-url`` flag
You can upload your distributions to TestPyPI using :ref:`twine` by specifying
the ``--repository`` flag

.. code::
$ twine upload --repository-url https://test.pypi.org/legacy/ dist/*
The ``legacy`` in the URL above refers to the legacy API for PyPI, which may
change as the Warehouse project progresses.
$ twine upload --repository testpypi dist/*
You can see if your package has successfully uploaded by navigating to the URL
``https://test.pypi.org/project/<sampleproject>`` where ``sampleproject`` is
Expand Down Expand Up @@ -59,29 +56,16 @@ you're testing has dependencies:
Setting up TestPyPI in pypirc
-----------------------------

If you want to avoid entering the TestPyPI url and your username
you can configure TestPyPI in your ``$HOME/.pypirc``.
If you want to avoid entering your username, you can configure TestPyPI in
your ``$HOME/.pypirc``.

Create or modify ``$HOME/.pypirc`` with the following:

.. code::
[distutils]
index-servers=
pypi
testpypi
[testpypi]
repository: https://test.pypi.org/legacy/
username: your testpypi username
.. Warning:: Do not store passwords in the pypirc file.
Storing passwords in plain text is never a good idea.

You can then tell :ref:`twine` to upload to TestPyPI by specifying the
``--repository`` flag:

.. code::
$ twine upload --repository testpypi dist/*
4 changes: 2 additions & 2 deletions source/tutorials/packaging-projects.rst
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,7 @@ Once installed, run Twine to upload all of the archives under :file:`dist`:

.. code-block:: bash
python3 -m twine upload --repository-url https://test.pypi.org/legacy/ dist/*
python3 -m twine upload --repository testpypi dist/*
You will be prompted for a username and password. For the username,
use ``__token__``. For the password, use the token value, including
Expand Down Expand Up @@ -346,7 +346,7 @@ differences:
main server.
* Use ``twine upload dist/*`` to upload your package and enter your credentials
for the account you registered on the real PyPI. Now that you're uploading
the package in production, you don't need to specify ``--repository-url``; the
the package in production, you don't need to specify ``--repository``; the
package will upload to https://pypi.org/ by default.
* Install your package from the real PyPI using ``pip install [your-package]``.

Expand Down

0 comments on commit 4c8a6ed

Please sign in to comment.