Skip to content

Commit

Permalink
remove distutils
Browse files Browse the repository at this point in the history
  • Loading branch information
ocefpaf committed Oct 4, 2023
1 parent af3a188 commit 295a33b
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions compliance_checker/suite.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
import warnings
from collections import defaultdict
from datetime import datetime, timezone
from distutils.version import StrictVersion
from operator import itemgetter
from pathlib import Path
from urllib.parse import urlparse
Expand All @@ -23,6 +22,7 @@
from netCDF4 import Dataset
from owslib.sos import SensorObservationService
from owslib.swe.sensor.sml import SensorML
from packaging.version import parse
from pkg_resources import working_set

from compliance_checker import __version__, tempnc
Expand Down Expand Up @@ -186,9 +186,8 @@ def _load_checkers(cls, checkers):
for spec, versions in itertools.groupby(ver_checkers, itemgetter(0)):
version_nums = [v[-1] for v in versions]
try:
latest_version = str(max(StrictVersion(v) for v in version_nums))
# if the version can't be parsed as a StrictVersion, parse
# according to character collation
latest_version = str(max(parse(v) for v in version_nums))
# if the version can't be parsed, do it according to character collation
except ValueError:
latest_version = max(version_nums)
cls.checkers[spec] = cls.checkers[spec + ":latest"] = cls.checkers[
Expand Down

0 comments on commit 295a33b

Please sign in to comment.