diff options
author | Eric Wieser <wieser.eric@gmail.com> | 2018-07-29 21:35:38 -0700 |
---|---|---|
committer | Eric Wieser <wieser.eric@gmail.com> | 2018-07-29 21:37:56 -0700 |
commit | 323458c4cd80935b61d2021181a47794ba81ccf3 (patch) | |
tree | 31a14f2f95959d602d28ad55aecef152f950c5b2 /tools | |
parent | 4013e5afa78b3dc40664b25f5fa5f2038019fdce (diff) | |
download | numpy-323458c4cd80935b61d2021181a47794ba81ccf3.tar.gz |
BUG: Increase required cython version on python 3.7
Relates to #11483
Diffstat (limited to 'tools')
-rwxr-xr-x | tools/cythonize.py | 14 |
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]) |