简体   繁体   English

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

[英]Why is Twine 1.9.1 still uploading to legacy PyPi?

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/ .我想将包上传到 pypi.org,如迁移到 PyPI.org文档中所述,但 Twine 上传到https://upload.pypi.org/legacy/

It's available on pypi.python.org/pypi/mypolr , but is not found on pypi.org .它在pypi.python.org/pypi/mypolr上可用,但在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:我的 pip.ini 文件(我使用的是 Windows 10)如下所示:

[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).我没有存储我的用户名或密码,所以 [pypi] 部分是空的(如迁移文档中所述)。

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 ).我已将 .ini 文件放在我的用户文件夹中,并确认( 根据此答案)它实际上使用的是我设置的文件(使用环境变量PIP_CONFIG_FILE )。

Afraid that I had got something wrong, I also tried without a pip.ini-file to make Twine use its defaults.害怕我做错了什么,我也尝试在没有 pip.ini 文件的情况下让 Twine 使用它的默认值。

I'm using Python 3.6.3 (from Anaconda), and my tools' versions are:我使用的是 Python 3.6.3(来自 Anaconda),我的工具版本是:

  • Twine 1.9.1 (migration docs says it should be 1.8+) Twine 1.9.1(迁移文档说它应该是 1.8+)
  • setuptools 38.2.3 (migration docs says it should be 27+) setuptools 38.2.3(迁移文档说它应该是 27+)

Whether or not it's relevant, here is some more info:无论是否相关,以下是更多信息:

  • Link to my setup.py链接到我的setup.py
  • setup is imported from setuptools and not distutils.core setup是从setuptools而不是distutils.core导入的
  • README.rst is used as long description , but in the PyPi page only first 8 asterix of header is shown. README.rst用作long description ,但在PyPi 页面中仅显示标题的前 8 个星号。 (Compare this with this ) 这个这个比较)
  • The package I upload is version is 0.2.1 (at the time of posting this)我上传的包版本是 0.2.1(发布时)
  • setuptools_scm is used to fetch versions from git tags setuptools_scm用于从 git 标签中获取版本
  • build is made with python setup.py sdist bdist_wheel使用python setup.py sdist bdist_wheel

Please let me know if there is any other information that could be useful to figure this out.请让我知道是否有任何其他信息可能有助于解决这个问题。

You appear to be doing everything correctly.你似乎做的一切都是正确的。 Twine is not uploading via legacy PyPI ( https://pypi.python.org ). Twine 不通过旧版 PyPI ( https://pypi.python.org ) 上传。 It is uploading to the new PyPI ( https://pypi.org , aka "Warehouse") via the original (and so far only) PyPI API, and this API just happens to be named "legacy".它正在通过原始(目前仅是)PyPI API 上传到新的 PyPI( https://pypi.org ,又名“仓库”),而这个 API 恰好被命名为“遗留”。

Also, your package is present on Warehouse at https://pypi.org/project/mypolr/ ;此外,您的包存在于 Warehouse 的https://pypi.org/project/mypolr/ 上 Warehouse search is apparently not production-ready.仓库搜索显然不是生产就绪的。

The docs for Warehouse explain this confusing nomenclature. Warehouse 的文档解释了这种令人困惑的命名法。 Quotes below are from the front page and from the page about the Legacy API :下面的引文来自首页和关于Legacy API的页面:

Warehouse is a web application that implements the canonical Python package index (repository) ; Warehouse 是一个Web 应用程序,它实现了规范的Python 包索引(存储库) its production deployment is PyPI .它的生产部署是PyPI It replaces an older code base that powered pypi.python.org.它取代了支持 pypi.python.org 的旧代码库。

Legacy API传统 API

The “Legacy API” provides feature parity with pypi-legacy , hence the term “legacy”. “Legacy API”提供与pypi-legacy 相同的功能,因此称为“legacy”。

... ...

Upload API上传接口

The API endpoint served at upload.pypi.org/legacy/ is Warehouse's emulation of the legacy PyPI upload API.在 upload.pypi.org/legacy/ 上提供的 API 端点是 Warehouse 对旧 PyPI 上传 API 的模拟。 This is the endpoint that tools such as twine and distutils use to upload distributions to PyPI .这是twinedistutils等工具用于 将分发上传到 PyPI的端点。

In other words, as I understand it:换句话说,据我了解:

  • PyPI was once a web application hosted at pypi.python.org. PyPI 曾经是托管在 pypi.python.org 的 Web 应用程序。 That old application, which no longer runs, is now referred to by the name pypi-legacy .那个不再运行的旧应用程序现在被称为pypi-legacy
  • PyPI is now a web application hosted at pypi.org. PyPI 现在是托管在 pypi.org 的 Web 应用程序。 This new application is named Warehouse .这个新应用程序名为Warehouse The old pypi.python.org is now just a redirect to pypi.org.旧的 pypi.python.org 现在只是重定向到 pypi.org。
  • In addition to some new endpoints, Warehouse still exposes a couple of API endpoints that pypi-legacy used to have.除了一些新的端点之外, Warehouse还公开了一些pypi-legacy曾经拥有的 API 端点。 Because these endpoints were copied across from pypi-legacy , they are together known as the "Legacy API".因为这些端点是从pypi-legacy复制过来的,所以它们统称为“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 .除此之外, Warehouse的 Legacy API 中的上传端点是从 URL 路径/legacy ,命名选择再次反映了这样一个事实,即它是pypi-legacy 中用于上传的端点的(部分)重新实现。

This all seems more confusing than it needs to be, but it is what it is.这一切似乎比它需要的更令人困惑,但事实就是如此。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM