0

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.

agctute
  • 123
  • 6
  • 1
    can you show the command you used to tag your commit ? reading the code in setup.py, versioneer.py and setup.cfg, `numpy` expects version tags in the `vX.Y.Z` format (with a leading `v`) – LeGEC May 17 '23 at 04:09
  • 2
    This should be a question for [the numpy project](https://github.com/numpy/numpy/issues), if you're trying to work on their codebase and following their instructions doesn't lead to a working setup. – Mike 'Pomax' Kamermans May 17 '23 at 04:09
  • also, the [README](https://github.com/numpy/numpy#readme) indicates to run `python -c "import numpy, sys; sys.exit(numpy.test() is False)"` (it wouldn't cost must to add a script, shell or python, and say "run that script", I'm just quoting the doc here) – LeGEC May 17 '23 at 04:21

2 Answers2

1

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.

Chr L
  • 89
  • 4
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.

LeGEC
  • 46,477
  • 5
  • 57
  • 104
  • Heads up to anyone working on Numpy specifically that they should run `git pull upstream main --tags` in order to try get theirs working instead of the tagging method. – agctute May 17 '23 at 17:46
  • @agctute : this should probably be reported directly to the numpy project. open an issue there. – LeGEC May 17 '23 at 19:53