5
votes

I want to upload packages to pypi.org as mentioned in the Migrating to PyPI.org documentation, but Twine uploads to https://upload.pypi.org/legacy/.

It's available on pypi.python.org/pypi/mypolr, but is not found on pypi.org.

I've tried to read several other questions, tutorials, and guides.

My pip.ini-file (I'm on Windows 10) looks like this:

[distutils]
index-servers =
    pypi

[pypi]

I don't have my username or password stored, so the [pypi] section is empty (as mentioned in migration docs).

I've put the .ini-file in my user folder, and confirmed (per this answer) that it's actually using the one I've set (using environment variable PIP_CONFIG_FILE).

Afraid that I had got something wrong, I also tried without a pip.ini-file to make Twine use its defaults.

I'm using Python 3.6.3 (from Anaconda), and my tools' versions are:

  • Twine 1.9.1 (migration docs says it should be 1.8+)
  • setuptools 38.2.3 (migration docs says it should be 27+)

Whether or not it's relevant, here is some more info:

  • Link to my setup.py
  • setup is imported from setuptools and not distutils.core
  • README.rst is used as long description, but in the PyPi page only first 8 asterix of header is shown. (Compare this with this)
  • The package I upload is version is 0.2.1 (at the time of posting this)
  • setuptools_scm is used to fetch versions from git tags
  • build is made with python setup.py sdist bdist_wheel

Please let me know if there is any other information that could be useful to figure this out.

2

2 Answers

7
votes

You appear to be doing everything correctly. Twine is not uploading via legacy PyPI (https://pypi.python.org). It is uploading to the new PyPI (https://pypi.org, a.k.a. "Warehouse") via the original (and so far only) PyPI API, and this API just happens to be named "legacy".

Also, your package is present on Warehouse at https://pypi.org/project/mypolr/; Warehouse search is apparently not production-ready.

3
votes

The docs for Warehouse explain this confusing nomenclature. Quotes below are from the front page and from the page about the Legacy API:

Warehouse is a web application that implements the canonical Python package index (repository); its production deployment is PyPI. It replaces an older code base that powered pypi.python.org.

Legacy API

The “Legacy API” provides feature parity with pypi-legacy, hence the term “legacy”.

...

Upload API

The API endpoint served at upload.pypi.org/legacy/ is Warehouse’s emulation of the legacy PyPI upload API. This is the endpoint that tools such as twine and distutils use to upload distributions to PyPI.

In other words, as I understand it:

  • PyPI was once a web application hosted at pypi.python.org. That old application, which no longer runs, is now referred to by the name pypi-legacy.
  • PyPI is now a web application hosted at pypi.org. This new application is named Warehouse. The old pypi.python.org is now just a redirect to pypi.org.
  • In addition to some new endpoints, Warehouse still exposes a couple of API endpoints that pypi-legacy used to have. Because these endpoints were copied across from pypi-legacy, they are together known as the "Legacy API".
  • In addition to that, the upload endpoint within Warehouse's Legacy API is served from the URL path /legacy, a naming choice which again reflects the fact that it is a (partial) reimplementation of the endpoint used for uploads in pypi-legacy.

This all seems more confusing than it needs to be, but it is what it is.