【发布时间】:2016-07-28 14:40:58
【问题描述】:
我正在(尝试)使用 setuptools 来构建一个包。我试图使用版本号 major.minor.mercurial_revision 但它抱怨:
The version specified ('1.0.7ae7970a82c1') 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.`
很好。所以我看一下 PEP 440,它基本上说“不要那样做”:
As hashes cannot be ordered reliably such versions are not permitted in the
public version field. As with semantic versioning, the public .devN
suffix may be used to uniquely identify such releases for publication,
while the original DVCS based label can be stored in the project metadata.
我理解这里的逻辑。但是我如何可以在项目元数据中包含 hg 修订?我找不到任何(最新的)文档来说明 setup.py:setup() 的参数可以包含哪些内容,但我发现 here 的 distutils 似乎没有为此提供字段。
【问题讨论】:
标签: python setuptools