Test PyPI服务器的新上传URL是什么?

时间:2017-08-04 21:17:53

标签: python pypi python-packaging

我正在尝试打包一个新项目并将其上传到TestPyPI服务器。由于引入了新的PyPI.org,我发现的几乎所有说明都已过时,现在尝试上传到https://testpypi.python.org/pypi会返回401 Gone

The guide for migrating to the new PyPI.org表示使用https://test.pypi.org/legacy作为TestPyPI的存储库。但是,当将此URL插入我的.pypirc文件并尝试上传我的包时,我收到以下错误:

python setup.py sdist upload -r testpypi
[...]
running upload
Submitting dist/<package_name> to https://test.pypi.org/legacy
Upload failed (404): Not Found
error: Upload failed (404): Not Found

以下是我的~/.pypirc文件的内容:

[distutils]
index-servers =
  pypi
  testpypi

[pypi]
repository: https://pypi.python.org/pypi
username: your_username
password: your_password

[testpypi]
repository: https://test.pypi.org/legacy
username: pbaranay
password: my_password

1 个答案:

答案 0 :(得分:4)

Test PyPI存储库的新URL是https://test.pypi.org/legacy/ - 注意尾部斜杠。迁移指南还说要使用此URL(包含斜杠)。