在packaging and distributing Python packages的文档中,它说要将twine
与.pypirc
中的repository = https://upload.pypi.org/legacy/
一起使用。现在,这个URL既是一种传统的做事方式,也是一种不存在的方式:
$ twine register dist/scriptdoctest-0.1-py2.py3-none-any.whl
Registering package to https://upload.pypi.org/legacy/
Enter your username: MyUserName
Enter your password:
Registering scriptdoctest-0.1-py2.py3-none-any.whl
HTTPError: 410 Client Error: This API is no longer supported, instead simply upload the file. for url: https://upload.pypi.org/legacy/
使用scriptdoctest.egg-info/PKG-INFO
现在是注册包的首选也是唯一的方法,还是有其他方法使用twine
或其他CLI工具来注册?在
https://packaging.python.org/distributing/实际上提供了所有必要的信息。在
TL;DR
setup.py
python setup.py sdist bdist_wheel
~/.pypirc
以及来自{a2}的凭据twine upload dist/*
-不再需要/不可能注册我的
.pypirc
如下所示:下面的马丁托马的答案现在似乎被否决了(here)。在
因此您的
.pypirc
应该如下所示:接下来,请执行以下步骤:
setup.py
。在创建车轮和距离:
为了避免重新输入密码,您可以在
~/.pypirc
中填充您的凭据 pypi。现在upload命令负责注册,因此命令现在是:
^{3美元使用这个存储库URL,它将工作
repository = https://upload.pypi.org/legacy/
。在我想文档有点过时了,因为打包已经发生了很多事情,包括转移到仓库:https://pypi.org/
相关问题 更多 >
编程相关推荐