Skip to content

Commit

Permalink
remove distutils function and change packaging.version
Browse files Browse the repository at this point in the history
  • Loading branch information
ifurther authored and astrofrog committed Jul 4, 2023
1 parent a890fa4 commit 2d4c8d8
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
6 changes: 3 additions & 3 deletions mpl_scatter_density/tests/__init__.py
Original file line number Diff line number Diff line change
@@ -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__))
Expand Down
1 change: 1 addition & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ install_requires =
numpy
matplotlib>=3.0
fast-histogram>=0.3
packaging

[options.extras_require]
test =
Expand Down
4 changes: 2 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
@@ -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)
Expand Down

0 comments on commit 2d4c8d8

Please sign in to comment.