PyPi 拒绝版本值
PyPi refuses version value
我正在尝试将包上传到 pypi 并出现错误:
'4.5.1-2021.2-0' 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 more information.
我知道我的名字不符合 PEP440 标准,但它符合 PyPi 值格式。奇怪,它将 _
替换为 -
来自setup.py
:
setuptools.setup(
name="opencv-python-inference-engine",
version="4.5.1_2021.2_0",
...
包文件名:opencv_python_inference_engine-4.5.1_2021.2_0-py3-none-manylinux1_x86_64.whl
除了 PRP440 合规性,我做错了什么?
UPD: '4.5.1-2021.2' 也会产生错误,但它看起来符合 PEP440(预发布分隔符)。
您的版本不符合 PEP440 标准。预发行版本必须包括预发行“阶段”(alpha、beta、候选发布版)。
The pre-release segment consists of an alphabetical identifier for the pre-release phase, along with a non-negative integer value. Pre-releases for a given release are ordered first by phase (alpha, beta, release candidate) and then by the numerical component within that phase.
X.YaN # Alpha release
X.YbN # Beta release
X.YrcN # Release Candidate
X.Y # Final release
对于 alpha,这意味着字母 a
,对于 beta,这意味着字母 b
,对于 Release Candidate,您需要 rc
。将破折号更改为 a
或 b
,我认为它会起作用。
我正在尝试将包上传到 pypi 并出现错误:
'4.5.1-2021.2-0' 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 more information.
我知道我的名字不符合 PEP440 标准,但它符合 PyPi 值格式。奇怪,它将 _
替换为 -
来自setup.py
:
setuptools.setup(
name="opencv-python-inference-engine",
version="4.5.1_2021.2_0",
...
包文件名:opencv_python_inference_engine-4.5.1_2021.2_0-py3-none-manylinux1_x86_64.whl
除了 PRP440 合规性,我做错了什么?
UPD: '4.5.1-2021.2' 也会产生错误,但它看起来符合 PEP440(预发布分隔符)。
您的版本不符合 PEP440 标准。预发行版本必须包括预发行“阶段”(alpha、beta、候选发布版)。
The pre-release segment consists of an alphabetical identifier for the pre-release phase, along with a non-negative integer value. Pre-releases for a given release are ordered first by phase (alpha, beta, release candidate) and then by the numerical component within that phase.
X.YaN # Alpha release
X.YbN # Beta release
X.YrcN # Release Candidate
X.Y # Final release
对于 alpha,这意味着字母 a
,对于 beta,这意味着字母 b
,对于 Release Candidate,您需要 rc
。将破折号更改为 a
或 b
,我认为它会起作用。