Skip to content

Commit c2ed0da

Browse files
committed
Strip leading 'v' symbol from tag name
1 parent b2da6fb commit c2ed0da

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

setuptools_git_versioning.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,7 @@ def version_from_git(
197197
tag = read_version_from_file(version_file)
198198

199199
if not count_commits_from_version_file:
200-
return tag
200+
return tag.lstrip("v") # for tag "v1.0.0" drop leading "v" symbol
201201

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

0 commit comments

Comments
 (0)