从github下载的托斯卡解析器,当使用python setup.py develop时,它会发出抱怨:该项目的版本控制要么需要一个sdist,要么需要访问上游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存储库?
发布于 2021-01-11 16:30:20
禁用pbr set PBR_VERSION的所有版本计算逻辑
$ export PBR_VERSION=1.2.3
$ python setup.py sdist或者在一条线上
$ PBR_VERSION=1.2.3 python setup.py sdist根据pbr文档
pbr在git中运行时,从git标记派生包的版本。当运行在一个带有适当的鸡蛋信息dir的球,它将高兴地从这个版本。因此,在大多数情况下,包维护人员不需要关心。但是,如果您正在做一些事情,比如将git与源和打包混合在一起,并且使pbr对其是否在自己的git回购中感到困惑,则可以设置PBR_VERSION。
https://stackoverflow.com/questions/58854822
复制相似问题