Skip to content

Commit 0b00b91

Browse files
authored
Merge pull request #48 from nitrictech/fix/rc-release-versioning
chore: produce PEP440 compliant dev versions from RC tags
2 parents 6305ebe + 4fb2242 commit 0b00b91

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

setup.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,12 @@ def get_current_version_tag():
1111
tags = str(output, "utf-8").strip().split("\n")
1212

1313
version_tags = [tag for tag in tags if re.match(r"^v?(\d*\.){2}\d$", tag)]
14-
dev_tags = [tag for tag in tags if re.match(r"^v?(\d*\.){2}\d-\d*-[a-z\d]{8}$", tag)]
14+
rc_tags = [tag for tag in tags if re.match(r"^v?(\d*\.){2}\d*-rc\.\d*$", tag)]
1515

1616
if len(version_tags) == 1:
1717
return version_tags.pop()[1:]
18-
elif len(dev_tags) == 1:
19-
base_tag, num_commits = dev_tags.pop().split("-")[:2]
18+
elif len(rc_tags) == 1:
19+
base_tag, num_commits = rc_tags.pop().split("-rc.")[:2]
2020
return "{}.dev{}".format(base_tag, num_commits)[1:]
2121
else:
2222
return "0.0.0.dev0"

0 commit comments

Comments
 (0)