Closed Gpetrak closed 2 weeks ago
@Gpetrak I would implement a more robust and complient method to check if a version is supported. Just comparing the major version with a list of numbers is a bit simplistic.
I suggest to implement a method (e.g. validate_version()
) to be used everywhere the version check is required, and compare the version with PEP440 semantics.
The plugin already contains a stripped version of packaging that can be used to parse and compare versions.
For example:
from vendor.packaging.version import Version
v332 = Version("3.3.2post1")
v442 = Version("4.4.2")
v500 = Version("5.0.0b0")
v332 < v442 < v500 # returns True
A check for a valid version should compare a min / max version
Thank you @giohappy . I just pushed a new commit regarding your recommendation.
This PR refactors the GeoNode API client module and drops the legacy support according to the issue: #287