我已安装 pip
pypirc
并使用必要的密码设置 ~/.pypirc
文件。为什么每次调用 python setup.py
时,tine
都要求输入密码?
$twine upload --repository-url https://test.pypi.org/legacy/ dist/*
Enter your username:
这是.pypirc
的形式
[distutils] # this tells distutils what package indexes you can push to
index-servers =
pypi
pypitest
[pypi]
repository: https://pypi.python.org/pypi
username: myuser
password: mypwd
[pypitest]
repository: https://testpypi.python.org/pypi
username: myuser
password: mypwd
更新不包含--repository-url
给出:
UploadToDeprecatedPyPIDetected: You're trying to upload to the legacy PyPI site 'https://pypi.python.org/pypi'. Uploading to those sites is deprecated.
The new sites are pypi.org and test.pypi.org. Try using https://upload.pypi.org/legacy/ (or https://test.pypi.org/legacy/) to upload your packages instead. These are the default URLs for Twine now.
More at https://packaging.python.org/guides/migrating-to-pypi-org/ .
最佳答案
twine upload dist/*
或
twine upload -r pypi dist/*
或
twine upload -r pypitest dist/*
据我了解twine --repository-url <url>
甚至没有咨询~/.pypirc
。与-r <name>
它查找 ~/.pypirc
获取 URL、用户名和密码。如果省略-r <name>
, twine 使用 ~/.pypirc
中的第一个存储库.
关于python - Twine 每次都要求我输入密码 : how to use the . pypirc,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57935191/