我正在尝试打包一个新项目并将其上传到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