summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatti Picus <matti.picus@gmail.com>2021-01-11 12:35:38 +0200
committerGitHub <noreply@github.com>2021-01-11 12:35:38 +0200
commita190258d4e90f2a17a9469e5dd9fb5f4b045aa90 (patch)
treecdb2c51ebbdfe30fc3ca47d96b0ffbf18b524597
parent09d5b2f8ad8a04eed93b6bc4789c4595bd33c2f2 (diff)
parent70a65fbee91d12cb4469e97bf5662821bb96f9e0 (diff)
downloadnumpy-a190258d4e90f2a17a9469e5dd9fb5f4b045aa90.tar.gz
Merge pull request #18144 from rgommers/cython-version-check
BLD: add found Cython version to check in cythonize.py
-rwxr-xr-xtools/cythonize.py5
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])