Thanks to visit codestin.com
Credit goes to github.com

Skip to content

BUG: numpy 1.26.0b1 fails to build from sdist when no git is present #24503

Description

@mkoeppe

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

Context for the issue:

sagemath/sage#36123

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions