我已安装
pip
并使用所需密码设置 pypirc
文件。为什么每次调用 ~/.pypirc
时 twine
都要求输入密码?python setup.py
这是
$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
或
twine upload dist/*
或
twine upload -r pypi dist/*
据我了解
twine upload -r pypitest dist/*
甚至没有咨询
twine --repository-url <url>
。使用 ~/.pypirc
,它会在 -r <name>
中查找 URL、用户名和密码。如果省略 ~/.pypirc
,twine 将使用 -r <name>
中的第一个存储库。~/.pypirc
你可以
python -m twine upload dist/* -u%username% -p%password%
或
set username="__token__"
set password="pypi-AgEIc..."