我正在尝试打包一个新项目并将其上传到 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
最佳答案
测试 PyPI 存储库的新 URL 是 https://test.pypi.org/legacy/ -- 注意结尾的斜线。迁移指南还说要使用此 URL(包含斜线)。
关于python - 测试 PyPI 服务器的新上传 URL 是什么?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45515643/