Commit 29122a6a authored by Jason Madden's avatar Jason Madden

Update to Cython 0.29

And stop the warnings about missing language_level.
parent 141ba158
......@@ -25,6 +25,11 @@ src/gevent/libev/_corecffi.c
src/gevent/libev/_corecffi.o
src/gevent/resolver/cares.c
# Cython annotations
src/gevent/*.html
src/gevent/libev/*.html
src/gevent/resolver/*.html
Makefile.ext
MANIFEST
*_flymake.py
......
......@@ -10,9 +10,13 @@
- Add support for application-wide callbacks when ``Greenlet`` objects
are started. See :pr:`1289`, provided by Yury Selivanov.
- It is now possible to consume ready objects using next(gevent.iwait(objs)).
- It is now possible to consume ready objects using `next(gevent.iwait(objs))`.
Previously such a construction would hang. See :pr:`1288`, provided by Josh
Snyder.
Snyder. This is not recommended, though, as unwaited objects will
have dangling links.
- Build with Cython 0.29 in '3str' mode.
1.3.7 (2018-10-12)
==================
......
......@@ -154,26 +154,49 @@ def system(cmd, cwd=None, env=None, **kwargs):
# Cython
# Based on code from
# http://cython.readthedocs.io/en/latest/src/reference/compilation.html#distributing-cython-modules
def _dummy_cythonize(extensions, **_kwargs):
for extension in extensions:
sources = []
for sfile in extension.sources:
path, ext = os.path.splitext(sfile)
if ext in ('.pyx', '.py'):
ext = '.c'
sfile = path + ext
sources.append(sfile)
extension.sources[:] = sources
return extensions
try:
from Cython.Build import cythonize
except ImportError:
# The .c files had better already exist. Based on code from
# http://cython.readthedocs.io/en/latest/src/reference/compilation.html#distributing-cython-modules
def cythonize(extensions, **_kwargs):
for extension in extensions:
sources = []
for sfile in extension.sources:
path, ext = os.path.splitext(sfile)
if ext in ('.pyx', '.py'):
ext = '.c'
sfile = path + ext
sources.append(sfile)
extension.sources[:] = sources
return extensions
# The .c files had better already exist.
cythonize = _dummy_cythonize
def cythonize1(ext):
new_ext = cythonize([ext], include_path=['src/gevent', 'src/gevent/libev', 'src/gevent/resolver'])[0]
try:
new_ext = cythonize(
[ext],
include_path=['src/gevent', 'src/gevent/libev', 'src/gevent/resolver'],
annotate=True,
compiler_directives={
'language_level': '3str',
'always_allow_keywords': False,
'infer_types': True,
'nonecheck': False,
}
)[0]
except ValueError:
# 'invalid literal for int() with base 10: '3str'
# This is seen when an older version of Cython is installed.
# It's a bit of a chicken-and-egg, though, because installing
# from dev-requirements first scans this egg for its requirements
# before doing any updates.
import traceback
traceback.print_exc()
new_ext = _dummy_cythonize([ext])[0]
for optional_attr in ('configure', 'optional'):
if hasattr(ext, optional_attr):
setattr(new_ext, optional_attr,
......
......@@ -4,8 +4,9 @@ wheel
# Python 3.7 requires at least Cython 0.27.3.
# 0.28 is faster, and (important!) lets us specify the target module
# name to be created so that we can have both foo.py and _foo.so
# at the same time.
Cython >= 0.28.5
# at the same time. 0.29 fixes some issues with Python 3.7,
# and adds the 3str mode for transition to Python 3.
Cython >= 0.29
# Python 3.7 requires at least 0.4.14, which is ABI incompatible with earlier
greenlet>=0.4.14 ; platform_python_implementation == "CPython"
......
......@@ -173,5 +173,5 @@ cdef _killall(list greenlets, object exception)
@cython.locals(done=list)
cpdef joinall(greenlets, timeout=*, raise_error=*, count=*)
cdef set _spawn_callbacks = None
cdef _call_spawn_callbacks(gr)
cdef set _spawn_callbacks
cdef void _call_spawn_callbacks(Greenlet gr) except *
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