From 618af16bc775d90a5a4643efd1fa6b013606c2ee Mon Sep 17 00:00:00 2001 From: Marvin W Date: Fri, 11 Apr 2025 19:22:51 +0200 Subject: Strip leading "v" from tag when generating display version --- libdino/version.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libdino/version.py b/libdino/version.py index dfbadb76..d057ddf2 100644 --- a/libdino/version.py +++ b/libdino/version.py @@ -26,7 +26,7 @@ def compute_version_from_git(git_repo, git): return None git_describe = subprocess.check_output([git, "describe", "--tags"], cwd=git_repo, text=True).strip() if git_release_tag == git_describe: - return git_release_tag + return git_release_tag[1:] matches = re.match("^.*-([0-9]+)-g([0-9a-f]+)$", git_describe) if matches is None: return None @@ -34,7 +34,7 @@ def compute_version_from_git(git_repo, git): git_commit_hash = matches.groups()[1] git_commit_time = subprocess.check_output([git, "show", "--format=%cd", "--date=format:%Y%m%d", "-s"], cwd=git_repo, text=True).strip() - return "%s~git%s.%s.%s" % (git_release_tag, git_tag_offset, git_commit_time, git_commit_hash) + return "%s~git%s.%s.%s" % (git_release_tag[1:], git_tag_offset, git_commit_time, git_commit_hash) except subprocess.CalledProcessError: pass return None -- cgit v1.3