Setuptools:从父目录中查找 SVN 修订版 [英] Setuptools: find SVN revision from a parent directory
问题描述
在我组装的 Python 包中,我使用了以下 setup.cfg
文件:
In the Python package I'm putting together I'm using the following setup.cfg
file:
[egg_info]
tag_build = dev
tag_date = 1
tag_svn_revision = 1
但是,当我运行 python setup.py sdist
时,SVN 修订版显示为 -r0
.这可能是因为我没有运行安装脚本的 .svn
目录;事实上我的树是
However when I run python setup.py sdist
the SVN revision appears as -r0
. This is likely because there is no .svn
directory where I run the setup script; in fact my tree is
main_dir/
.svn/
branches/
trunk/
setup.py
setup.cfg
如何告诉 setuptools
在父目录中查找 SVN 修订号?我仍然想继续使用我的包版本号.
How can I tell setuptools
to go find the SVN revision number in a parent directory? I still want to keep using my package version number.
推荐答案
如果您愿意安装另一个包,您可以用不同的方式解决 -r0
问题.自版本 10 以来,Setuptools 不支持 SVN 元数据.该功能已移至 setuptools_svn 包.
You can solve the -r0
problem in a different way if you're willing to install another package. Setuptools does not support the SVN metadata since version 10. The functionality has been moved to the setuptools_svn package.
这篇关于Setuptools:从父目录中查找 SVN 修订版的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!