Skip to content

Commit

Permalink
MAINT: git security shim for 1.9.x (#16329)
Browse files Browse the repository at this point in the history
replicated gh-16139 on the latest maintenance branch
because the `master` branch of the wheels repo will
encounter the issues described in that PR (for example, see:
MacPython/scipy-wheels#166 which
has Travis and Azure failures caused by those same
versioning issues)

[ci skip]
  • Loading branch information
tylerjereddy committed Jun 1, 2022
1 parent b9bb99c commit 8620a22
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion tools/version_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,13 @@ def _minimal_ext_cmd(cmd):
return out

try:
out = _minimal_ext_cmd(['git', 'rev-parse', 'HEAD'])
git_dir = os.path.abspath(os.path.dirname(os.path.dirname(__file__)))
git_dir = os.path.join(git_dir, ".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 8620a22

Please sign in to comment.