summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCharles Harris <charlesr.harris@gmail.com>2018-07-31 14:53:09 -0500
committerGitHub <noreply@github.com>2018-07-31 14:53:09 -0500
commit5a0a136c5de9d48a9fc2603cffad0c7b97710ed4 (patch)
treeb08c614b692e6e3180c0a92b0500b49df44cc8c0
parentb0832bd6d28c4ec109184c37673984cdc677156c (diff)
parent323458c4cd80935b61d2021181a47794ba81ccf3 (diff)
downloadnumpy-5a0a136c5de9d48a9fc2603cffad0c7b97710ed4.tar.gz
Merge pull request #11484 from eric-wieser/bump-cython-version
BUG: Increase required cython version on python 3.7
-rwxr-xr-xtools/cythonize.py14
1 files changed, 12 insertions, 2 deletions
diff --git a/tools/cythonize.py b/tools/cythonize.py
index f97f111d1..9e2af840d 100755
--- a/tools/cythonize.py
+++ b/tools/cythonize.py
@@ -70,8 +70,18 @@ def process_pyx(fromfile, tofile):
else:
# check the version, and invoke through python
from distutils.version import LooseVersion
- if LooseVersion(cython_version) < LooseVersion('0.19'):
- raise Exception('Building %s requires Cython >= 0.19' % VENDOR)
+
+ # requiring the newest version on all pythons doesn't work, since
+ # we're relying on the version of the distribution cython. Add new
+ # versions as they become required for new python versions.
+ if sys.version_info[:2] < (3, 7):
+ required_version = LooseVersion('0.19')
+ else:
+ required_version = LooseVersion('0.28')
+
+ if LooseVersion(cython_version) < required_version:
+ raise RuntimeError('Building {} requires Cython >= {}'.format(
+ VENDOR, required_version))
subprocess.check_call(
[sys.executable, '-m', 'cython'] + flags + ["-o", tofile, fromfile])