Twine 每次都要求我输入密码:如何使用 .pypirc

问题描述 投票:0回答:3

我已安装

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


python setuptools twine
3个回答
23
投票

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>
中的第一个存储库。
    


4
投票

~/.pypirc

你可以

python -m twine upload dist/* -u%username% -p%password%

set username="__token__" set password="pypi-AgEIc..."



-1
投票
它会起作用...


© www.soinside.com 2019 - 2024. All rights reserved.