diff options
author | Charles Harris <charlesr.harris@gmail.com> | 2022-02-04 16:21:58 -0700 |
---|---|---|
committer | Charles Harris <charlesr.harris@gmail.com> | 2022-02-05 10:05:54 -0700 |
commit | df8d1fd3c2077ca785b0948912162e03727ace6c (patch) | |
tree | 01dc1266363997d7fd8e181a2cfefaddaef9751c /numpy/random/tests/test_extending.py | |
parent | f32f47d58e51111a9c995b2f53dab0d0bdb1c927 (diff) | |
download | numpy-df8d1fd3c2077ca785b0948912162e03727ace6c.tar.gz |
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.
Diffstat (limited to 'numpy/random/tests/test_extending.py')
-rw-r--r-- | numpy/random/tests/test_extending.py | 8 |
1 files changed, 4 insertions, 4 deletions
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 |