问题:Versioning for this project requires either an sdist tarball, or access to an upstream git repository. It’s also possible that there is a mismatch between the package name in setup.cfg and the argument given to pbr.version.VersionInfo. Project name XXX was given, but was not able to be found.

分析:从问题描述可见由两种可能原因。1 是 Python 项目的上游仓库除了问题。2 是 Python 项目的 Version 字符串不匹配。

解决:

可能要更新 distribute
pip install --upgrade distribute
1
可能是 git repo 除了问题,执行 git log 检查 git 工具是否正常。

查看 setup.cfg 中的 [metadata] name 和 version_info = pbr.version.VersionInfo('XXX') 是否一致。

如果你并不关心 git repo 的联系,那么可以直接关闭 PBR 的版本逻辑。参考文档:https://stackoverflow.com/questions/58854822/python-setup-py-sdist-error-versioning-for-this-project-requires-either-an-sdist

$ export PBR_VERSION=1.2.3
$ python setup.py sdist
————————————————
版权声明:本文为CSDN博主「范桂飓」的原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接及本声明。
原文链接:https://blog.csdn.net/Jmilk/article/details/104644825

发表评论

邮箱地址不会被公开。 必填项已用*标注