From 9ea0db8a816a877f60bf39d4fab71d341d5993c3 Mon Sep 17 00:00:00 2001 From: David Manthey Date: Thu, 17 Feb 2022 12:01:06 -0500 Subject: [PATCH] Change how we do a version check. We had been using distutils.version.StrictVersion, but that is deprecated and packaging.version.parse is the preferred method. --- sources/gdal/large_image_source_gdal/girder_source.py | 4 ++-- sources/gdal/setup.py | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/sources/gdal/large_image_source_gdal/girder_source.py b/sources/gdal/large_image_source_gdal/girder_source.py index bb36dd18a..8eadc9e7a 100644 --- a/sources/gdal/large_image_source_gdal/girder_source.py +++ b/sources/gdal/large_image_source_gdal/girder_source.py @@ -15,8 +15,8 @@ ############################################################################# import re -from distutils.version import StrictVersion +import packaging.version from girder_large_image.girder_tilesource import GirderTileSource from osgeo import gdal @@ -48,7 +48,7 @@ def _getLargeImagePath(self): try: largeImageFileId = self.item['largeImage']['fileId'] largeImageFile = File().load(largeImageFileId, force=True) - if (StrictVersion(gdal.__version__) >= StrictVersion('2.1.3') and + if (packaging.version.parse(gdal.__version__) >= packaging.version.parse('2.1.3') and largeImageFile.get('linkUrl') and not largeImageFile.get('assetstoreId') and re.match(r'(http(|s)|ftp)://', largeImageFile['linkUrl'])): diff --git a/sources/gdal/setup.py b/sources/gdal/setup.py index bc072560c..62920e6e5 100644 --- a/sources/gdal/setup.py +++ b/sources/gdal/setup.py @@ -45,6 +45,7 @@ def prerelease_local_scheme(version): install_requires=[ 'large-image', 'gdal', + 'packaging', 'pyproj>=2.2.0', 'importlib-metadata ; python_version < "3.8"', ],