themill / wiz

Environment management framework
GNU Lesser General Public License v3.0
45 stars 4 forks source link

Fix sorting of versions for search results #57

Closed Svenito closed 3 years ago

Svenito commented 4 years ago

Uses a custom compare function to sort the versions into the correct order. This however highlights an issue with the versioning as they don't always follow official semantic version conventions

Therefore the regular expression was modified to handle edge cases that cropped up in preliminary testing. Unfortunately I don't know what possible version formats there can be out there, so this handles what I've seen so far, which includes:

There could be any number of version formats used out there, so it might be worth verifying versions with something like the Python semver package to ensure that the compare function doesn't get even longer to handle all the possible formats and restrict versioning to formats that follow the semantic version spec.

If the priority is to allow for any version format, then unfortunately sorting them will become rather complicated.

FIX #7