Skip to content

Commit b2da6fb

Browse files
committed
String leading 'v' symbol from tag name
1 parent 8b662e5 commit b2da6fb

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

setuptools_git_versioning.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -228,4 +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-
return public + sep + local_sanitized
231+
public_sanitized = public.lstrip("v") # for tag "v1.0.0" drop leading "v" symbol
232+
return public_sanitized + sep + local_sanitized

0 commit comments

Comments
 (0)