gpt4 book ai didi

python setup.py sdist 错误此项目的版本控制需要 sdist tarball,或访问上游 git 存储库

转载 作者:行者123 更新时间:2023-12-03 09:39:41 25 4
gpt4 key购买 nike

tosca-parser 从 github 下载, 使用时 python setup.py develop ,它提示:此项目的版本控制需要 sdist tarball,或访问上游 git 存储库。所以我使用 python setup.py sdist相反,错误是相同的:

ERROR:root:Error parsing
Traceback (most recent call last):
File "/usr/lib/python2.7/site-packages/pbr/core.py", line 96, in pbr
attrs = util.cfg_to_args(path, dist.script_args)
File "/usr/lib/python2.7/site-packages/pbr/util.py", line 270, in cfg_to_args
pbr.hooks.setup_hook(config)
File "/usr/lib/python2.7/site-packages/pbr/hooks/__init__.py", line 25, in setup_hook
metadata_config.run()
File "/usr/lib/python2.7/site-packages/pbr/hooks/base.py", line 27, in run
self.hook()
File "/usr/lib/python2.7/site-packages/pbr/hooks/metadata.py", line 26, in hook
self.config['name'], self.config.get('version', None))
File "/usr/lib/python2.7/site-packages/pbr/packaging.py", line 874, in get_version
name=package_name))
Exception: 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 tosca-parser was given, but was not able to be found.
error in setup command: Error parsing /home/tiina/tosca/tosca-parser-master/setup.cfg: Exception: 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 tosca-parser was given, but was not able to be found.

我在 git init 之后运行相同的命令,那么错误就消失了。我不明白的是从哪里需要上游 git 存储库?

最佳答案

禁用pbr set的所有版本计算逻辑 PBR_VERSION

$ export PBR_VERSION=1.2.3 
$ python setup.py sdist
或在一行上
$ PBR_VERSION=1.2.3 python setup.py sdist
根据 pbr docs

pbr, when run in a git repo, derives the version of a package from the git tags. When run in a tarball with a proper egg-info dir, it will happily pull the version from that. So for the most part, the package maintainers shouldn’t need to care. However, if you are doing something like keeping a git repo with the sources and the packaging intermixed and it’s causing pbr to get confused about whether its in its own git repo or not, you can set PBR_VERSION

关于python setup.py sdist 错误此项目的版本控制需要 sdist tarball,或访问上游 git 存储库,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58854822/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com