Numpy tests cannot parse version

huangapple go评论100阅读模式
英文:

Numpy tests cannot parse version

问题

在分叉 Numpy 存储库并为其设置开发容器后,我尝试运行 python runtests.py -v,但返回以下错误

  1. 正在构建,请参阅 build.log...
  2. 回溯(最近的调用最后):
  3. 文件 "/workspaces/numpy/setup.py",第 47 行,在 <module>
  4. raise RuntimeError(f'无法解析版本 {FULLVERSION}')
  5. 运行时错误:无法解析版本 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

  1. Building, see build.log...
  2. Traceback (most recent call last):
  3. File "/workspaces/numpy/setup.py", line 47, in <module>
  4. raise RuntimeError(f'Cannot parse version {FULLVERSION}')
  5. 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)

  1. git tag v1.2.3.dev

Also worth noting: the Readme gives instructions to run the tests with:

  1. 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.

huangapple
  • 本文由 发表于 2023年5月17日 10:29:42
  • 转载请务必保留本文链接:https://go.coder-hub.com/76268200.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定