Skip to content

Commit

Permalink
build: allow installing without git (#492)
Browse files Browse the repository at this point in the history
  • Loading branch information
branchvincent authored Dec 4, 2023
1 parent ebc5f3e commit d2c22f5
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -142,11 +142,14 @@ def parse_version(version_file):
version = ci_version
else:
sha = (
subprocess.check_output(["git", "rev-parse", "--short", "HEAD"], cwd=here)
.decode("ascii")
subprocess.run(
["git", "rev-parse", "--short", "HEAD"], capture_output=True, cwd=here
)
.stdout.decode("ascii")
.strip()
)
version += f"+{sha}"
if sha:
version += f"+{sha}"

return version

Expand Down

0 comments on commit d2c22f5

Please sign in to comment.