From df8d1fd3c2077ca785b0948912162e03727ace6c Mon Sep 17 00:00:00 2001 From: Charles Harris Date: Fri, 4 Feb 2022 16:21:58 -0700 Subject: MAINT: Replace LooseVersion by _pep440. LooseVersion is provided by Python distutils, which is going away in 3.12. This PR vendors _pep440 from scipy and uses it as a replacement. Numpy distutils is not touched, replacing LooseVersion in that package was considered too risky, and numpy distutils will need to go away when Python distutils does. --- numpy/random/tests/test_extending.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'numpy/random/tests/test_extending.py') diff --git a/numpy/random/tests/test_extending.py b/numpy/random/tests/test_extending.py index d362092b5..58adb66c7 100644 --- a/numpy/random/tests/test_extending.py +++ b/numpy/random/tests/test_extending.py @@ -31,13 +31,13 @@ try: except ImportError: cython = None else: - from distutils.version import LooseVersion - # Cython 0.29.21 is required for Python 3.9 and there are + from numpy.compat import _pep440 + # Cython 0.29.24 is required for Python 3.10 and there are # other fixes in the 0.29 series that are needed even for earlier # Python versions. # Note: keep in sync with the one in pyproject.toml - required_version = LooseVersion('0.29.21') - if LooseVersion(cython_version) < required_version: + required_version = '0.29.24' + if _pep440.parse(cython_version) < _pep440.Version(required_version): # too old or wrong cython, skip the test cython = None -- cgit v1.2.1