python
config_error
ai_generated
true
错误:无效的版本字符串:'1.0.0-beta'
error: Invalid version string: '1.0.0-beta'
ID: python/setuptools-version-string-invalid
80%修复率
85%置信度
0证据数
2024-09-14首次发现
版本兼容性
| 版本 | 状态 | 引入 | 弃用 | 备注 |
|---|---|---|---|---|
| 3.8 | active | — | — | — |
根因分析
Setuptools使用PEP 440版本规范;'1.0.0-beta'不符合规范;应为'1.0.0b1'。
English
Setuptools uses PEP 440 versioning; '1.0.0-beta' is not compliant; should be '1.0.0b1'.
解决方案
-
95% 成功率 Use PEP 440 compliant version
version='1.0.0b1'
-
90% 成功率 Use setuptools_scm for automatic versioning
pip install setuptools_scm # setup.py setup(use_scm_version=True)
无效尝试
常见但无效的做法:
-
Using '1.0.0-beta1'
80% 失败
Still not PEP 440 compliant; hyphen not allowed for pre-releases.
-
Removing pre-release label entirely
60% 失败
Loses version semantics; may cause confusion.