作者热门文章
- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我正在尝试使用 twine upload dist/*
命令上传我的包。我得到一个错误:
Client Error: 'X.Y.ZZ.post0.dev0-g83905ac' is an invalid value for Version. Error:
在我看来,X.Y.ZZ.post0.dev0-g83905ac
版本确实满足 PEP 440 .我不明白这是怎么回事。
我已经创建了 annotetade 标签等。我想我已经创建了标签。
$ git tag -a vX.Y.ZZ # Don't forget the leading v
fatal: tag 'vX.Y.ZZ' already exists
我注意到 sdist 命令返回错误:
user:package user-13$ python3 setup.py sdist
/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/setuptools/dist.py:483: UserWarning: The version specified ('X.Y.ZZ.post0.dev0+g83905ac') is an invalid version, this may not work as expected with newer versions of setuptools, pip, and PyPI. Please see PEP 440 for more details.
"details." % self.metadata.version
我确实拥有所有内容的最新版本:
user:package user-13$ pip3 --version
pip 19.2.3 from /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/pip (python 3.7)
user: package femto-13$ python3 --version
Python 3.7.4
user: package femto-13$ twine --version
twine version 1.14.0 (pkginfo: 1.5.0.1, requests: 2.22.0, setuptools: 41.2.0,
requests-toolbelt: 0.9.1, tqdm: 4.35.0)
历史:
917 git tag -a vX.Y.ZZ # Don't forget the leading v
918 git push origin vX.Y.ZZ
919 python3 setup.py sdist
920 python3 setup.py bdist_wheel
921 twine upload dist/*
这是 twine 命令的结果:
user:package user-13$ twine upload dist/*
Uploading distributions to https://upload.pypi.org/legacy/
Uploading py_package-X.Y.ZZ.post0.dev0_g83905ac-py3-none-any.whl
100%|███████████████████████████████████████████████████████████████████████| 18.5k/18.5k [00:00<00:00, 37.9kB/s]
NOTE: Try --verbose to see response content.
HTTPError: 400 Client Error: 'X.Y.ZZ.post0.dev0-g83905ac' is an invalid value for Version. Error: Start and end with a letter or numeral containing only ASCII numeric and '.', '_' and '-'. See https://packaging.python.org/specifications/core-metadata for url: https://upload.pypi.org/legacy/
我已将标签更新为 0.0.1 并删除了所有 X.Y.Z 标签。
最佳答案
版本 X.Y.ZZ.post0.dev0-g83905ac
不是 PyPI 的有效版本号。它包含提交哈希 g83905ac
和 PEP 440说:
Many build tools integrate with distributed version control systems like Git and Mercurial in order to add an identifying hash to the version identifier. As hashes cannot be ordered reliably such versions are not permitted in the public version field.
关于python - 麻线上传区。得到错误 "is an invalid value for Version",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57912086/
我是一名优秀的程序员,十分优秀!