diff --git a/setup.py b/setup.py index 94e72b80f5e6..3723910f8356 100755 --- a/setup.py +++ b/setup.py @@ -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,