diff options
author | Charles Harris <charlesr.harris@gmail.com> | 2022-02-08 10:53:21 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-02-08 10:53:21 -0700 |
commit | a6f55fe293502dd94eccb3799efdbaaa1d5ff1df (patch) | |
tree | 7de5a6bd467439d3c96c610b2529c2abb562b026 /tools/cythonize.py | |
parent | 9d3735a6c0781585a4a6cd767f68967d3897b38b (diff) | |
parent | df8d1fd3c2077ca785b0948912162e03727ace6c (diff) | |
download | numpy-a6f55fe293502dd94eccb3799efdbaaa1d5ff1df.tar.gz |
Merge pull request #21000 from charris/replace-looseversion
MAINT: Replace LooseVersion by _pep440.
Diffstat (limited to 'tools/cythonize.py')
-rwxr-xr-x | tools/cythonize.py | 29 |
1 files changed, 2 insertions, 27 deletions
diff --git a/tools/cythonize.py b/tools/cythonize.py index c06962cf9..002b2fad7 100755 --- a/tools/cythonize.py +++ b/tools/cythonize.py @@ -48,33 +48,8 @@ def process_pyx(fromfile, tofile): if tofile.endswith('.cxx'): flags.append('--cplus') - try: - # try the cython in the installed python first (somewhat related to scipy/scipy#2397) - import Cython - from Cython.Compiler.Version import version as cython_version - except ImportError as e: - # The `cython` command need not point to the version installed in the - # Python running this script, so raise an error to avoid the chance of - # using the wrong version of Cython. - msg = 'Cython needs to be installed in Python as a module' - raise OSError(msg) from e - else: - # check the version, and invoke through python - from distutils.version import LooseVersion - - # Cython 0.29.21 is required for Python 3.9 and there are - # other fixes in the 0.29 series that are needed even for earlier - # Python versions. - # Note: keep in sync with that in pyproject.toml - # Update for Python 3.10 - required_version = LooseVersion('0.29.24') - - if LooseVersion(cython_version) < required_version: - cython_path = Cython.__file__ - raise RuntimeError(f'Building {VENDOR} requires Cython >= {required_version}' - f', found {cython_version} at {cython_path}') - subprocess.check_call( - [sys.executable, '-m', 'cython'] + flags + ["-o", tofile, fromfile]) + subprocess.check_call( + [sys.executable, '-m', 'cython'] + flags + ["-o", tofile, fromfile]) def process_tempita_pyx(fromfile, tofile): |