Skip to content

Commit

Permalink
Strip leading 'v' symbol from tag name
Browse files Browse the repository at this point in the history
  • Loading branch information
dolfinus committed Oct 28, 2021
1 parent b2da6fb commit c2ed0da
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions setuptools_git_versioning.py
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ def version_from_git(
tag = read_version_from_file(version_file)

if not count_commits_from_version_file:
return tag
return tag.lstrip("v") # for tag "v1.0.0" drop leading "v" symbol

tag_sha = get_latest_file_commit(version_file)
else:
Expand Down Expand Up @@ -228,5 +228,5 @@ def version_from_git(
# Ensure local version label only contains permitted characters
public, sep, local = version.partition("+")
local_sanitized = re.sub(r"[^a-zA-Z0-9.]", ".", local)
public_sanitized = public.lstrip("v") # for tag "v1.0.0" drop leading "v" symbol
public_sanitized = public.lstrip("v") # for version "v1.0.0" drop leading "v" symbol
return public_sanitized + sep + local_sanitized

0 comments on commit c2ed0da

Please sign in to comment.