Commit c0dd02dc authored by Jason Madden's avatar Jason Madden

Prevent building on too old a PyPy; don't build on CPython if CFFI too old.

parent 845c39df
...@@ -12,6 +12,7 @@ gevent/_corecffi.o ...@@ -12,6 +12,7 @@ gevent/_corecffi.o
*.egg-info *.egg-info
Makefile.ext Makefile.ext
MANIFEST MANIFEST
*_flymake.py
greentest/.coverage\.* greentest/.coverage\.*
greentest/htmlcov greentest/htmlcov
......
...@@ -359,15 +359,22 @@ else: ...@@ -359,15 +359,22 @@ else:
setup_kwds = {} setup_kwds = {}
try: try:
__import__('cffi') cffi = __import__('cffi')
except ImportError: except ImportError:
setup_kwds = {} setup_kwds = {}
else: else:
_min_cffi_version = (1, 3, 0)
_cffi_version_is_supported = cffi.__version_info__ >= _min_cffi_version
_kwds = {'cffi_modules': cffi_modules} _kwds = {'cffi_modules': cffi_modules}
# We already checked for PyPy on Windows above and excluded it # We already checked for PyPy on Windows above and excluded it
if PYPY: if PYPY:
if not _cffi_version_is_supported:
raise Exception("PyPy 2.6.1 or higher is required")
setup_kwds = _kwds setup_kwds = _kwds
elif LIBEV_EMBED and (not WIN or CFFI_WIN_BUILD_ANYWAY): elif LIBEV_EMBED and (not WIN or CFFI_WIN_BUILD_ANYWAY):
if not _cffi_version_is_supported:
print("WARNING: CFFI version 1.3.0 is required to build CFFI backend", file=sys.stderr)
else:
# If we're on CPython, we can only reliably build # If we're on CPython, we can only reliably build
# the CFFI module if we're embedding libev (in some cases # the CFFI module if we're embedding libev (in some cases
# we wind up embedding it anyway, which may not be what the # we wind up embedding it anyway, which may not be what the
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment