Numpy tests cannot parse version


After forking the Numpy repository and setting up the dev container for it, I attempted to run python -v but it returns the following error

Building, see build.log...
Traceback (most recent call last):
  File "/workspaces/numpy/", 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.

Asked By: agctute



I can get past this error by running versioneer install --vendor, as per 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.

Answered By: Chr L

As LeGEC mentioned, the problem was that I was tagging the commit with instead of Adding the v allowed the tag to be accepted.

Answered By: agctute

Reading the code on the numpy repository (in, and setup.cfg):

numpy expects version tags in the vX.Y.Z format (with a leading v, and 3 dot separated numbers)

git tag

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.

Answered By: LeGEC