为什么 Twine 1.9.1 仍在上传到旧版 PyPi?

Why is Twine 1.9.1 still uploading to legacy PyPi?

我想将包上传到 pypi.org,如 Migrating to PyPI.org 文档中所述,但 Twine 上传到 https://upload.pypi.org/legacy/

它在 pypi.python.org/pypi/mypolr, but is not found on pypi.org 可用。

我试过阅读 其他几个问题、教程和指南。

我的 pip.ini-文件(我在 Windows 10)看起来像这样:

[distutils]
index-servers =
    pypi

[pypi]

我没有存储我的用户名或密码,所以 [pypi] 部分是空的(如迁移文档中所述)。

我已将 .ini 文件放在我的用户文件夹中,并确认 () 它实际上使用的是我设置的文件(使用环境变量 PIP_CONFIG_FILE)。

怕我搞错了,我也试过不使用 pip.ini 文件让 Twine 使用它的默认值。

我正在使用 Python 3.6.3(来自 Anaconda),我的工具版本是:

无论是否相关,这里有一些更多信息:

如果有任何其他信息可以帮助解决这个问题,请告诉我。

你似乎做的一切都正确。 Twine 没有通过原始的(到目前为止仅)PyPI API 通过旧版 PyPI(https://pypi.python.org). It is uploading to the new PyPI (https://pypi.org、a.k.a、"Warehouse")上传,而这个 API 只是恰好被命名为 "legacy".

此外,您的包裹在 https://pypi.org/project/mypolr/ 的仓库中;仓库搜索显然不是生产就绪的。

Warehouse 的文档解释了这个令人困惑的术语。以下引述来自 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.

换句话说,据我了解:

  • PyPI 曾经是托管在 pypi.python.org 的 Web 应用程序。那个不再运行的旧应用程序现在被称为 pypi-legacy.
  • PyPI 现在是托管在 pypi.org 的 Web 应用程序。这个新应用程序名为 Warehouse。旧的 pypi.python.org 现在只是重定向到 pypi.org.
  • 除了一些新的端点,Warehouse 仍然公开了几个 API 端点,pypi-legacy 曾经用于有。因为这些端点是从 pypi-legacy 复制过来的,所以它们一起被称为 "Legacy API".
  • 除此之外,Warehouse 的遗留 API 中的上传端点是从 URL 路径 /legacy 提供的,a命名选择再次反映了一个事实,即它是 pypi-legacy.
  • 中用于上传的端点的(部分)重新实现

这一切似乎比需要的更令人困惑,但事实就是如此。