Skip to content

Commit

Permalink
get last 1.4 version not v2 (#252)
Browse files Browse the repository at this point in the history
  • Loading branch information
CaselIT authored Apr 4, 2023
1 parent 58fd993 commit 5ddca8b
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion .github/workflows/scripts/find_version.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,17 @@ def go(argv: list[str]):
)
assert result.status == 200
parsed = json.loads(result.read())
version = parsed["info"]["version"]
# `releases` is deprecated but should be good for now
# https://warehouse.pypa.io/api-reference/json.html
v14 = sorted(
[key for key in parsed["releases"] if key.startswith("1.4")],
key=lambda key: [
int(part) if part.isdecimal() else -1
for part in key.split(".")
],
)
version = v14[-1]
# version = parsed["info"]["version"] # this is now v2
print(f"rel_{version}".replace(".", "_"))
else:
for part in argv:
Expand Down

0 comments on commit 5ddca8b

Please sign in to comment.