Skip to content

Commit

Permalink
Fix version fallback mechanism
Browse files Browse the repository at this point in the history
  • Loading branch information
lumbric committed May 14, 2024
1 parent 6458015 commit a1f9f0e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion syfop/version.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ def get_version():
# - if it is a shallow clone with --depth 1
try:
git_tag = subprocess.check_output(["git", "describe", "--tags"], stderr=subprocess.STDOUT)
git_tag = git_tag.decode().strip()
except subprocess.CalledProcessError:
# TODO I'm giving up on this one. No idea how to do it the right way.
# readthedocs fails to get the tag if it is more than 50 commits away from HEAD...
Expand All @@ -17,7 +18,6 @@ def get_version():
# raise RuntimeError(f"Unable to get version from Git: {e}: {e.output.decode()}")

# TODO we don't check if the tag is a valid version string (e.g. v0.1.0).
git_tag = git_tag.decode().strip()
version = git_tag.lstrip("v")

# convert string from git-describe to a valid PEP440 version string
Expand Down

0 comments on commit a1f9f0e

Please sign in to comment.