英文:
Numpy tests cannot parse version
问题
在分叉 Numpy 存储库并为其设置开发容器后,我尝试运行 python runtests.py -v
,但返回以下错误
正在构建,请参阅 build.log...
回溯(最近的调用最后):
文件 "/workspaces/numpy/setup.py",第 47 行,在 <module> 中
raise RuntimeError(f'无法解析版本 {FULLVERSION}')
运行时错误:无法解析版本 0+untagged.32327.g0200e4a
我认为这与最后一次提交未标记有关,因为 0200e4a
与最后一次提交的 id 的第一部分相匹配,但标记该提交并检出并没有起作用。
英文:
After forking the Numpy repository and setting up the dev container for it, I attempted to run python runtests.py -v
but it returns the following error
Building, see build.log...
Traceback (most recent call last):
File "/workspaces/numpy/setup.py", line 47, in <module>
raise RuntimeError(f'Cannot parse version {FULLVERSION}')
RuntimeError: Cannot parse version 0+untagged.32327.g0200e4a
I think it has something to do with the last commit being untagged, as 0200e4a
matches the first part of the last commit id, but tagging the commit and checking it out did not work.
答案1
得分: 1
我可以通过运行versioneer install --vendor
来解决这个错误,参考https://github.com/python-versioneer/python-versioneer#vendored-mode。但我不确定这样做是否会与上游NumPy的更改发生冲突,您可能需要在分支中同步这些更改。不幸的是,一开始我在NumPy的GitHub wiki上找不到相关信息。
英文:
I can get past this error by running versioneer install --vendor
, as per https://github.com/python-versioneer/python-versioneer#vendored-mode. But I'm not sure if and how this will conflict with upstream NumPy changes, which you will want to sync in the fork. Unfortunately, I can't find anything about this in the NumPy GitHub wiki at first glance.
答案2
得分: 1
Reading the code on the numpy repository (in setup.py
, versioneer.py
, and setup.cfg)
:
numpy expects version tags in the vX.Y.Z[suffix]
format (with a leading v
, and 3 dot-separated numbers)
git tag v1.2.3.dev
Also worth noting: the Readme gives instructions to run the tests with:
python -c "import numpy, sys; sys.exit(numpy.test() is False)"
so if you don't need to also test the build step, you may try that.
I'm not competent enough to say if this instruction is still up to date, though.
英文:
Reading the code on the numpy repository (in setup.py
, versioneer.py
and setup.cfg
):
numpy expects version tags in the vX.Y.Z[suffix]
format (with a leading v
, and 3 dot separated numbers)
git tag v1.2.3.dev
Also worth noting: the Readme gives instructions to run the tests with:
python -c "import numpy, sys; sys.exit(numpy.test() is False)"
so if you don't need to also test the build step, you may try that.
I'm not competent enough to say if this instruction is still up to date, though.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论