python - Twine 每次都要求我输入密码 : how to use the . pypirc

标签 python setuptools twine

我已安装 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/

相关文章:

python - 无法在 pypi.org 上更新我的包

python - cKDTree 与 dsearchn

python - Pygame背景音乐不播放

python - 如何将字符串拆分为字符列表?

python - pip 是否可以从 setup.cfg 安装,就像从需求文件安装一样?

python - 没有名为 'pkg_resources' 的模块

python - 按值从 MySQL 数组中删除列表元素的正确语法

python - python 项目是否需要 MANIFEST.in,其中应该包含什么?

python - 是否可以使用 OpenID 在 PyPI 上上传 python 包?

python - 为什么 Twine 1.9.1 仍在上传到旧版 PyPi?