Skip to content

Commit

Permalink
BUG: Support PEP440 style alpha and beta versions
Browse files Browse the repository at this point in the history
Support alpha and beta version syntax from PEP440 for python plugins
see https://peps.python.org/pep-0440/
  • Loading branch information
T4mmi committed Jan 14, 2025
1 parent a7b8dfe commit 50785de
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions python/pyplugin_installer/version_compare.py
Original file line number Diff line number Diff line change
Expand Up @@ -126,9 +126,9 @@ def compareElements(s1, s2):
return 2
# if the strings aren't numeric or start from 0, compare them as a strings:
# but first, set ALPHA < BETA < PREVIEW < RC < TRUNK < [NOTHING] < [ANYTHING_ELSE]
if s1 not in ["ALPHA", "BETA", "PREVIEW", "RC", "TRUNK"]:
if s1 not in ["A", "ALPHA", "B", "BETA", "PREVIEW", "RC", "TRUNK"]:
s1 = "Z" + s1
if s2 not in ["ALPHA", "BETA", "PREVIEW", "RC", "TRUNK"]:
if s2 not in ["A", "ALPHA", "B", "BETA", "PREVIEW", "RC", "TRUNK"]:
s2 = "Z" + s2
# the final test:
if s1 > s2:
Expand Down

0 comments on commit 50785de

Please sign in to comment.