[Distutils] Uploading to Warehouse

Donald Stufft donald at stufft.io
Sun Jun 5 09:42:59 EDT 2016


Hey all,

As anyone here who has uploaded anything to PyPI recently is aware of, PyPI's
uploading routine has been in a semi broken state for awhile now. It will
regularly raise a 500 error (but will often still record the release, but
sometimes only a partial release).

Well, the good news is, that Warehouse's upload routines should generally be
good enough to use now. This will be more or less the same as if you uploaded
to PyPI itself (they share a backing data store) but hitting the newer, better
code base instead of the slowly decaying legacy code base. You can upload via
Warehouse by editing your ~/.pypirc file and making it look something like
this:


    [distutils]
    index-servers =
        pypi
        warehouse

    [pypi]
    username:<username>
    password:<password>

    [warehouse]
    repository:https://upload.pypi.io/legacy/
    username:<username>
    password:<password>

Alternatively, you can ditch the [warehouse] section, and just totally switch
over to this by doing:

    [distutils]
    index-servers =
        pypi

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

Then you can upload using ``twine upload -r warehouse dist/*`` or
``twine upload dist/*`` based upon which of the above options you picked. This
code is not as battle tested as PyPI itself is, so if you run into any bugs
please file an issue with https://github.com/pypa/warehouse. This code should
generally give a successful response all of the time (given the upload itself
was good) and properly utilizes database transactions so that it should
completely eliminate the cases where you get a partial upload.

Hopefully this will help solve some of the problems folks are having with PyPI
in the interim before we can completely switch over to Warehouse.

—
Donald Stufft





More information about the Distutils-SIG mailing list