python - 测试 PyPI 服务器的新上传 URL 是什么?

标签 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

最佳答案

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

关于python - 测试 PyPI 服务器的新上传 URL 是什么?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45515643/

相关文章:

python - 如何使用rest API查询Azure表存储

python - 获取 PyPI 历史记录中不再列出的旧包版本

python - 基于平台创建pythonwheel

Python包从外部调用时无法导入邻居子包

python - 从项目内部获取Python诗歌项目的版本

python - 404 尝试链接到另一个页面 Flask 时出错

python - 删除 <select> 元素的正则表达式

python - 如何在tensorflow中使用predict_proba进行DNNClassifier?

python - 使我的 pypi 脚本可执行,而无需每次都指定脚本的路径

python - 在 pypi 上注册包时为 "Server response (401): You must login to access this feature"