Skip to content

Commit

Permalink
reverse
Browse files Browse the repository at this point in the history
  • Loading branch information
tinnawong committed Sep 19, 2023
1 parent 51e4827 commit 07d5c40
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,16 @@
.strip()
)

if remote_version.startswith("v"):
if "-" in remote_version:
v,i,s = remote_version.split("-")
remote_version = v + "+" + i + ".git." + s
if "-" in remote_version:
# when not on tag, git describe outputs: "1.3.3-22-gdf81228"
# pip has gotten strict with version numbers
# so change it to: "1.3.3+22.git.gdf81228"
# See: https://peps.python.org/pep-0440/#local-version-segments
v,i,s = remote_version.split("-")
remote_version = v + "+" + i + ".git." + s

assert "-" not in remote_version
assert "." in remote_version
assert "-" not in remote_version
assert "." in remote_version

with open("README.md", "r") as f:
long_description = f.read()
Expand Down

0 comments on commit 07d5c40

Please sign in to comment.