Skip to content

Commit

Permalink
Fix Python version incompatibilities with semantic versioning (#651)
Browse files Browse the repository at this point in the history
  • Loading branch information
jgiannuzzi authored Nov 27, 2023
1 parent 3809ce1 commit c760cf6
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion python/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,10 @@ def get_data_files():

def get_version():
version = os.environ.get("VERSION")
return version.replace("-", "+", 1)
# Translate from semver to Python version specifier
# see https://semver.org
# see https://packaging.python.org/en/latest/specifications/version-specifiers/#pre-releases
return version.replace("-alpha.", "a", 1).replace("-beta.", "b", 1).replace("-rc.", "rc", 1).replace("-", "+", 1)


def get_platform():
Expand Down

0 comments on commit c760cf6

Please sign in to comment.