Skip to content

Commit

Permalink
MAINT: git security shim for 1.9.x
Browse files Browse the repository at this point in the history
* replicated scipygh-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)

* I think the `cwd` is still correct even though the patch
is being applied to a different file this time (used to be
`setup.py`), though we could double check this by pointing
the wheels PR at the commit hash of this PR if we want

* any reason not to forward port this as well at this point,
if we're going to need to keep backporting it?
  • Loading branch information
tylerjereddy committed May 31, 2022
1 parent b9bb99c commit a1ad2c7
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion tools/version_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,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 a1ad2c7

Please sign in to comment.