Python包版本标准

时间:2015-03-16 17:39:22

标签: python

根据PEP440,以下格式似乎是有效的版本字符串:

X.Y.postN    # Post-release

但是当我使用类似于:1.0.post1的东西时,我在pbr中得到以下异常。 (我使用的是pbr版本0.11.0)

ERROR:root:Error parsing
Traceback (most recent call last):
    File "/usr/local/lib/python2.7/dist-packages/pbr/core.py", line 104, in pbr
    attrs = util.cfg_to_args(path)
    File "/usr/local/lib/python2.7/dist-packages/pbr/util.py", line 238, in cfg_to_args
    pbr.hooks.setup_hook(config)
    File "/usr/local/lib/python2.7/dist-packages/pbr/hooks/__init__.py", line 27, in setup_hook
    metadata_config.run()
    File "/usr/local/lib/python2.7/dist-packages/pbr/hooks/base.py", line 29, in run
    self.hook()
    File "/usr/local/lib/python2.7/dist-packages/pbr/hooks/metadata.py", line 28, in hook
    self.config['name'], self.config.get('version', None))
    File "/usr/local/lib/python2.7/dist-packages/pbr/packaging.py", line 1009, in get_version
    version = _get_version_from_git(pre_version)
    File "/usr/local/lib/python2.7/dist-packages/pbr/packaging.py", line 947, in _get_version_from_gitpre_version)
    File "/usr/local/lib/python2.7/dist-packages/pbr/version.py", line 236, in from_pip_string
% (remainder, version_string))
ValueError: Unknown remainder ['post1'] in '1.0.post1'
error in setup command: Error parsing /home/admin/mypackage/setup.cfg:

ValueError: Unknown remainder ['post1'] in '1.0.post1'

有人知道为什么PBR不支持这种格式吗?

1 个答案:

答案 0 :(得分:1)

参考文档:http://docs.openstack.org/developer/pbr/#version

版本应与“Linux Compatible Semantic Versioning 3.0.0”兼容:http://docs.openstack.org/developer/pbr/semver.html