Skip to content

Commit

Permalink
just use version at the moment
Browse files Browse the repository at this point in the history
  • Loading branch information
yzh119 committed Jan 28, 2024
1 parent 98c26bc commit 1426742
Showing 1 changed file with 0 additions and 13 deletions.
13 changes: 0 additions & 13 deletions python/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,22 +27,9 @@
root = pathlib.Path(__name__).parent


def get_local_version_suffix() -> str:
now = datetime.datetime.now()
git_hash = subprocess.check_output(
["git", "rev-parse", "--short", "HEAD"], cwd=root, text=True
).strip()
commit_number = subprocess.check_output(
["git", "rev-list", "HEAD", "--count"], cwd=root, text=True
).strip()
dirty = ".dirty" if subprocess.run(["git", "diff", "--quiet"]).returncode else ""
return f"+c{commit_number}.d{now:%Y%m%d}.{git_hash}{dirty}"


def get_version():
with open(root / "version.txt") as f:
version = f.read().strip()
version += get_local_version_suffix()
return version


Expand Down

0 comments on commit 1426742

Please sign in to comment.