diff options
author | Ralf Gommers <ralf.gommers@gmail.com> | 2021-01-09 21:40:56 +0100 |
---|---|---|
committer | Ralf Gommers <ralf.gommers@gmail.com> | 2021-01-11 10:50:16 +0100 |
commit | 70a65fbee91d12cb4469e97bf5662821bb96f9e0 (patch) | |
tree | d4aa32a4ecd673e5ac903041def2a522ff5c1e58 | |
parent | fde2e536a1c1a1ba90727958f0b6da34fa53db1f (diff) | |
download | numpy-70a65fbee91d12cb4469e97bf5662821bb96f9e0.tar.gz |
BLD: add found Cython version to check in cythonize.py
Ref gh-18138, which has a confusing situation where the
correct version seems installed but this check still raises.
-rwxr-xr-x | tools/cythonize.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/tools/cythonize.py b/tools/cythonize.py index 6cebf0f72..911b81243 100755 --- a/tools/cythonize.py +++ b/tools/cythonize.py @@ -56,6 +56,7 @@ def process_pyx(fromfile, tofile): 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: # The `cython` command need not point to the version installed in the @@ -73,7 +74,9 @@ def process_pyx(fromfile, tofile): required_version = LooseVersion('0.29.21') if LooseVersion(cython_version) < required_version: - raise RuntimeError(f'Building {VENDOR} requires Cython >= {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]) |