Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,11 +49,12 @@ def is_platform_mac():
try:
import Cython

ver = Cython.__version__
_CYTHON_VERSION = Cython.__version__
from Cython.Build import cythonize

_CYTHON_INSTALLED = ver >= LooseVersion(min_cython_ver)
_CYTHON_INSTALLED = _CYTHON_VERSION >= LooseVersion(min_cython_ver)
except ImportError:
_CYTHON_VERSION = None
_CYTHON_INSTALLED = False
cythonize = lambda x, *args, **kwargs: x # dummy func

Expand Down Expand Up @@ -506,6 +507,11 @@ def maybe_cythonize(extensions, *args, **kwargs):

elif not cython:
# GH#28836 raise a helfpul error message
if _CYTHON_VERSION:
raise RuntimeError(
f"Cannot cythonize with old Cython version ({_CYTHON_VERSION} "
f"installed, needs {min_cython_ver})"
)
raise RuntimeError("Cannot cythonize without Cython installed.")

numpy_incl = pkg_resources.resource_filename("numpy", "core/include")
Expand Down