Twine每次都在询问我的密码:如何使用.pypi

2024-05-12 17:27:25 发布

您现在位置:Python中文网/ 问答频道 /正文

我已经pip安装了pypirc,并用必需的密码设置了一个~/.pypirc文件。为什么每次调用twine都要求输入密码?在

  $twine upload --repository-url https://test.pypi.org/legacy/ dist/*
  Enter your username:

这是.pypirc的形式

^{pr2}$

更新不包括--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/ .

Tags: thetohttpsorgtestpypiurl密码
1条回答
网友
1楼 · 发布于 2024-05-12 17:27:25
twine upload dist/*

或者

^{pr2}$

或者

twine upload -r pypitest dist/*

据我所知,twine repository-url <url>甚至不咨询~/.pypirc。使用-r <name>它可以在~/.pypirc中查找URL、用户名和密码。如果省略-r <name>,twine将使用来自~/.pypirc的第一个repo。在

相关问题 更多 >