Skip to content

Commit

Permalink
format version of Non-Tagged Commit if from version.py
Browse files Browse the repository at this point in the history
  • Loading branch information
rwxayheee committed Sep 6, 2024
1 parent c10579e commit 776fe12
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 1 deletion.
Binary file added .DS_Store
Binary file not shown.
Binary file added build/.DS_Store
Binary file not shown.
8 changes: 7 additions & 1 deletion build/python/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,13 @@ def find_version():
version = f.read().strip()

print('Version found: %s (from version.py)' % version)
return version

git_output = subprocess.check_output(['git', 'describe', '--abbrev=7', '--dirty=@mod', '--always', '--tags'])
git_output = git_output.strip().decode()

if git_output.startswith('v'):
git_output = git_output[1:]
return f"{git_output}+{version}"

try:
git_output = subprocess.check_output(['git', 'describe', '--abbrev=7', '--dirty=@mod', '--always', '--tags'])
Expand Down

0 comments on commit 776fe12

Please sign in to comment.