Closed
Description
Describe the issue:
<edit>
: (@mattip) Adding the root cause:
The version is missing from the sdist for 1.26b1, resulting in an attempt to get it via git
. But that does not work because ...
<edit>
The gitversion.py
script introduced in #24196 is broken when no git
binary is available.
Reproduce the code example:
$ python3 numpy/_build_utils/gitversion.py
Error message:
$ python3 numpy/_build_utils/gitversion.py
Traceback (most recent call last):
File "/sage/local/var/lib/sage/venv-python3.11/var/tmp/sage/build/numpy-1.26.0b1/src/numpy/_build_utils/gitversion.py", line 68, in <module>
version, git_hash = git_version(init_version())
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/sage/local/var/lib/sage/venv-python3.11/var/tmp/sage/build/numpy-1.26.0b1/src/numpy/_build_utils/gitversion.py", line 53, in git_version
return version, git_hash
^^^^^^^^
UnboundLocalError: cannot access local variable 'git_hash' where it is not associated with a value
Runtime information:
N/A