diff --git a/mpl_scatter_density/tests/__init__.py b/mpl_scatter_density/tests/__init__.py index 99e098e..0f96f24 100644 --- a/mpl_scatter_density/tests/__init__.py +++ b/mpl_scatter_density/tests/__init__.py @@ -1,14 +1,14 @@ import os -from distutils.version import LooseVersion +from packaging.version import Version import matplotlib -MPL_VERSION = LooseVersion(matplotlib.__version__) +MPL_VERSION = Version(matplotlib.__version__) baseline_root = 'baseline' -if MPL_VERSION >= LooseVersion('3'): # pragma: nocover +if MPL_VERSION >= Version('3'): # pragma: nocover baseline_subdir = '3.0.x' else: # pragma: nocover raise ValueError('Matplotlib {0} is not supported'.format(matplotlib.__version__)) diff --git a/setup.cfg b/setup.cfg index 902eb38..be21da6 100644 --- a/setup.cfg +++ b/setup.cfg @@ -17,6 +17,7 @@ install_requires = numpy matplotlib>=3.0 fast-histogram>=0.3 + packaging [options.extras_require] test = diff --git a/setup.py b/setup.py index 6008dbf..dfd34b1 100644 --- a/setup.py +++ b/setup.py @@ -1,11 +1,11 @@ #!/usr/bin/env python import sys -from distutils.version import LooseVersion +from packaging.version import Version try: import setuptools - assert LooseVersion(setuptools.__version__) >= LooseVersion('30.3') + assert Version(setuptools.__version__) >= Version('30.3') except (ImportError, AssertionError): sys.stderr.write("ERROR: setuptools 30.3 or later is required\n") sys.exit(1)