Commit e04cff4b authored by Jason Madden's avatar Jason Madden

Updating greenlet dependency versions and fallback header.

Leaving some notes about needed cleanup.

This first push is just to make sure all the other versions besides 3.11 continue to do their thing.
parent c55bec14
......@@ -234,6 +234,7 @@ def cythonize1(ext):
'.',
]
try:
print("XXX: Drop compile_time_env")
new_ext = cythonize(
[ext],
include_path=standard_include_paths,
......@@ -244,6 +245,10 @@ def cythonize1(ext):
'infer_types': True,
'nonecheck': False,
},
# XXX: Cython developers say: "Please use C macros instead
# of Pyrex defines. Taking this kind of decision based on
# the runtime environment of the build is wrong, it needs
# to be taken at C compile time."
compile_time_env={
'PY39B1': sys.hexversion >= 0x030900B1,
},
......
......@@ -14,6 +14,15 @@ extern "C" {
/* This is deprecated and undocumented. It does not change. */
#define GREENLET_VERSION "1.0.0"
#if PY_VERSION_HEX >= 0x30B00A6
# define GREENLET_PY311 1
/* _PyInterpreterFrame moved to the internal C API in Python 3.11 */
# include <internal/pycore_frame.h>
#else
# define GREENLET_PY311 0
# define _PyCFrame CFrame
#endif
typedef struct _greenlet {
PyObject_HEAD
char* stack_start;
......@@ -25,6 +34,12 @@ typedef struct _greenlet {
PyObject* run_info;
struct _frame* top_frame;
int recursion_depth;
#if GREENLET_PY311
_PyInterpreterFrame *current_frame;
_PyStackChunk *datastack_chunk;
PyObject **datastack_top;
PyObject **datastack_limit;
#endif
PyObject* weakreflist;
#if PY_VERSION_HEX >= 0x030700A3
_PyErr_StackItem* exc_info;
......@@ -39,7 +54,7 @@ typedef struct _greenlet {
PyObject* context;
#endif
#if PY_VERSION_HEX >= 0x30A00B1
CFrame* cframe;
_PyCFrame* cframe;
#endif
} PyGreenlet;
......
......@@ -22,13 +22,14 @@ requires = [
# This was fixed in 3.0a5 (https://github.com/cython/cython/issues/3578)
# 3.0a6 fixes an issue cythonizing source on 32-bit platforms.
# 3.0a9 is needed for Python 3.10.
"Cython >= 3.0a9",
"Cython >= 3.0a11",
# See version requirements in setup.py
"cffi >= 1.12.3 ; platform_python_implementation == 'CPython'",
# Python 3.7 requires at least 0.4.14, which is ABI incompatible with earlier
# releases. Python 3.9 and 3.10 require 0.4.16;
# 0.4.17 is ABI incompatible with earlier releases, but compatible with 1.0
"greenlet >= 0.4.17, < 2.0 ; platform_python_implementation == 'CPython'",
# 1.1.3 is needed for CPython 3.11
"greenlet >= 1.1.3, < 2.0 ; platform_python_implementation == 'CPython'",
]
[tool.towncrier]
......
......@@ -201,7 +201,8 @@ greenlet_requires = [
# the release of 1.0a1 it began promising ABI stability with SemVer
# so we can add an upper bound).
# 1.1.0 is required for 3.10; it has a new ABI, but only on 1.1.0.
'greenlet >= 1.1.0, < 2.0; platform_python_implementation=="CPython"',
# 1.1.3 is needed for 3.11, and supports everything 1.1.0 did.
'greenlet >= 1.1.3, < 2.0; platform_python_implementation=="CPython"',
]
# Note that we don't add cffi to install_requires, it's
......
......@@ -54,7 +54,7 @@ cdef inline void greenlet_init():
ctypedef object CodeType
IF PY39B1:
IF PY39B1: # XXX: Move all of this to C includes. Pyrex defines are not appropriate, according to the Cython devs.
ctypedef object FrameType
cdef extern from "Python.h":
......
......@@ -425,8 +425,9 @@ class TestCase(TestCaseMetaClass("NewBase",
# Python 3 can check a lot more than Python 2 can.
continue
self.assertEqual(sig.args, gevent_sig.args, func_name)
# The next two might not actually matter?
# The next three might not actually matter?
self.assertEqual(sig.varargs, gevent_sig.varargs, func_name)
self.assertEqual(sig.keywords, gevent_sig.keywords, func_name)
self.assertEqual(sig.defaults, gevent_sig.defaults, func_name)
# Should deal with others: https://docs.python.org/3/library/inspect.html#inspect.getfullargspec
......
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