GeoNode / QGISGeoNodePlugin

A QGIS plugin that provides integration with GeoNode
https://geonode.org/QGISGeoNodePlugin/
GNU General Public License v3.0
12 stars 16 forks source link

Issue#287: Refactor GeoNode API client module and drop legacy support #288

Closed Gpetrak closed 2 weeks ago

Gpetrak commented 2 weeks ago

This PR refactors the GeoNode API client module and drops the legacy support according to the issue: #287

giohappy commented 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

Gpetrak commented 2 weeks ago

Thank you @giohappy . I just pushed a new commit regarding your recommendation.