首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >此项目的setup.py sdist错误版本控制需要sdist或对上游git存储库的访问。

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

Stack Overflow用户
提问于 2019-11-14 10:40:40
回答 1查看 5.2K关注 0票数 9

github下载的托斯卡解析器,当使用python setup.py develop时,它会发出抱怨:该项目的版本控制要么需要一个sdist,要么需要访问上游git存储库。因此,我使用python setup.py sdist代替,错误是相同的:

代码语言:javascript
复制
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存储库?

EN

回答 1

Stack Overflow用户

发布于 2021-01-11 16:30:20

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

代码语言:javascript
复制
$ export PBR_VERSION=1.2.3 
$ python setup.py sdist

或者在一条线上

代码语言:javascript
复制
$ PBR_VERSION=1.2.3 python setup.py sdist

根据pbr文档

pbr在git中运行时,从git标记派生包的版本。当运行在一个带有适当的鸡蛋信息dir的球,它将高兴地从这个版本。因此,在大多数情况下,包维护人员不需要关心。但是,如果您正在做一些事情,比如将git与源和打包混合在一起,并且使pbr对其是否在自己的git回购中感到困惑,则可以设置PBR_VERSION

票数 5
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/58854822

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档