Skip to content

Commit

Permalink
BLD, MAINT: git security/version shim
Browse files Browse the repository at this point in the history
* this is an attempt to deal with the new
security measure in git:
https://github.blog/2022-04-12-git-security-vulnerability-announced/

* it has been blocking the release of SciPy 1.8.1
and NumPy point release for some time

* I'm going to try to point the problem wheels
repo PR at the hash of this commit/branch before
merging if possible:
MacPython/scipy-wheels#167

* based on feedback from Henry over here, this does
seem to help locally:
pypa/manylinux#1309 (comment)
  • Loading branch information
tylerjereddy committed May 8, 2022
1 parent a6a2fe5 commit b227e3a
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,9 @@ def _minimal_ext_cmd(cmd):
return out

try:
out = _minimal_ext_cmd(['git', 'rev-parse', 'HEAD'])
cwd = os.getcwd()
git_dir = os.path.join(cwd, ".git")
out = _minimal_ext_cmd(['git', '--git-dir', git_dir, 'rev-parse', 'HEAD'])
GIT_REVISION = out.strip().decode('ascii')[:7]

# We need a version number that's regularly incrementing for newer commits,
Expand Down

0 comments on commit b227e3a

Please sign in to comment.