unascribed / FlexVer

A SemVer-compatible intuitive comparator for free-form versioning strings as seen in the wild, designed to sort versions like people do.
Creative Commons Zero v1.0 Universal
65 stars 10 forks source link

Python 3.8+ port #22

Closed ENDERZOMBI102 closed 1 year ago

ENDERZOMBI102 commented 1 year ago

Implement FlexVer in Python via a FlexVer class which implements total ordering and a compare(str, str): int function which is like the Java FlexVerComparator.compare() implementation.

This was tested on Python 3.8 up to 3.11, using the files in the tests folder as input.

If this is accepted, We will publish it to PyPi under the flexver name.

ENDERZOMBI102 commented 1 year ago

for the spaces between parentheses, its for readability, they help us understand divide symbols and words, make things easier to parse. although can remove if needed.

the camelCase is just personal preference, will change the casing as we've also noticed that the PEP says to use snake_case

ENDERZOMBI102 commented 1 year ago

moved to snake_case and fixed workflow/tests

unascribed commented 1 year ago

Thanks!

ENDERZOMBI102 commented 1 year ago

published! as said, can be found under flexver on pypi: https://pypi.org/project/flexver