Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gevent
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
gevent
Commits
e8c18b79
Commit
e8c18b79
authored
Nov 20, 2020
by
Jason Madden
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Updates to work with greenlet 1.0a1
parent
dc02c69c
Changes
6
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
79 additions
and
97 deletions
+79
-97
.travis.yml
.travis.yml
+1
-1
appveyor.yml
appveyor.yml
+2
-1
deps/greenlet/greenlet.h
deps/greenlet/greenlet.h
+67
-92
pyproject.toml
pyproject.toml
+1
-1
setup.py
setup.py
+4
-2
src/gevent/tests/test__util.py
src/gevent/tests/test__util.py
+4
-0
No files found.
.travis.yml
View file @
e8c18b79
...
...
@@ -184,7 +184,7 @@ jobs:
# UnicodeEncodeError: 'ascii' codec can't encode character u'\u2588' in position 6: ordinal not in range(128)
# when downloading files. This started sometime in mid 2020. It's from
# pip's vendored progress.bar class.
-
&build-gevent-deps
pip install -U -q setuptools wheel twine && pip install -q -U 'faulthandler; python_version == "2.7" and platform_python_implementation == "CPython"' 'cffi;platform_python_implementation=="CPython"' 'cython>=3.0a5' 'greenlet;platform_python_implementation=="CPython"'
-
&build-gevent-deps
pip install -U -q setuptools wheel twine && pip install -q -U 'faulthandler; python_version == "2.7" and platform_python_implementation == "CPython"' 'cffi;platform_python_implementation=="CPython"' 'cython>=3.0a5' 'greenlet
>=1.0a1
;platform_python_implementation=="CPython"'
# Next, build the wheel *in place*. This helps ccache, and also lets us cache the configure
# output (pip install uses a random temporary directory, making this difficult)
-
python setup.py bdist_wheel
...
...
appveyor.yml
View file @
e8c18b79
...
...
@@ -179,10 +179,11 @@ build_script:
# Try to get some things that don't wind up in the pip cache as
# built wheels if they're built during an isolated build.
-
"
%CMD_IN_ENV%
%PYEXE%
-m
pip
install
--pre
-U
wheel
cython
setuptools
cffi"
-
if not "%GWHEEL_ONLY%"=="true" %PYEXE% -m pip install -U -e .[test]
-
if not "%GWHEEL_ONLY%"=="true" %PYEXE% -m pip install -
-pre -
U -e .[test]
test_script
:
# Run the project tests
-
if not "%GWHEEL_ONLY%"=="true" %PYEXE% -c "import greenlet; print(greenlet, greenlet.__version__)"
-
if not "%GWHEEL_ONLY%"=="true" %PYEXE% -c "import gevent.core; print(gevent.core.loop)"
-
if not "%GWHEEL_ONLY%"=="true" %PYEXE% -c "import gevent; print(gevent.config.settings['resolver'].get_options())"
-
if not "%GWHEEL_ONLY%"=="true" %PYEXE% -c "from gevent._compat import get_clock_info; print(get_clock_info('perf_counter'))"
...
...
deps/greenlet/greenlet.h
View file @
e8c18b79
/*
vim:set noet ts=8 sw=8 :
*/
/*
-*- indent-tabs-mode: nil; tab-width: 4; -*-
*/
/* Greenlet object interface */
...
...
@@ -11,19 +11,8 @@
extern
"C"
{
#endif
#define GREENLET_VERSION "0.4.17"
#if PY_VERSION_HEX >= 0x030700A3
# define GREENLET_USE_EXC_INFO
#endif
#ifndef GREENLET_USE_CONTEXT_VARS
#ifdef Py_CONTEXT_H
#define GREENLET_USE_CONTEXT_VARS 1
#else
#define GREENLET_USE_CONTEXT_VARS 0
#endif
#endif
/* This is deprecated and undocumented. It does not change. */
#define GREENLET_VERSION "1.0.0"
typedef
struct
_greenlet
{
PyObject_HEAD
...
...
@@ -37,7 +26,7 @@ typedef struct _greenlet {
struct
_frame
*
top_frame
;
int
recursion_depth
;
PyObject
*
weakreflist
;
#if
def GREENLET_USE_EXC_INFO
#if
PY_VERSION_HEX >= 0x030700A3
_PyErr_StackItem
*
exc_info
;
_PyErr_StackItem
exc_state
;
#else
...
...
@@ -46,21 +35,17 @@ typedef struct _greenlet {
PyObject
*
exc_traceback
;
#endif
PyObject
*
dict
;
#if
GREENLET_USE_CONTEXT_VARS
#if
PY_VERSION_HEX >= 0x030700A3
PyObject
*
context
;
#endif
}
PyGreenlet
;
#define PyGreenlet_Check(op) PyObject_TypeCheck(op, &PyGreenlet_Type)
#define PyGreenlet_MAIN(op)
(((PyGreenlet*)(op))->stack_stop == (char*)
-1)
#define PyGreenlet_MAIN(op)
(((PyGreenlet*)(op))->stack_stop == (char*)
-1)
#define PyGreenlet_STARTED(op) (((PyGreenlet*)(op))->stack_stop != NULL)
#define PyGreenlet_ACTIVE(op) (((PyGreenlet*)(op))->stack_start != NULL)
#define PyGreenlet_GET_PARENT(op) (((PyGreenlet*)(op))->parent)
#if (PY_MAJOR_VERSION == 2 && PY_MINOR_VERSION >= 7) || (PY_MAJOR_VERSION == 3 && PY_MINOR_VERSION >= 1) || PY_MAJOR_VERSION > 3
#define GREENLET_USE_PYCAPSULE
#endif
/* C API functions */
/* Total number of symbols that are exported */
...
...
@@ -78,23 +63,24 @@ typedef struct _greenlet {
#ifndef GREENLET_MODULE
/* This section is used by modules that uses the greenlet C API */
static
void
**
_PyGreenlet_API
=
NULL
;
static
void
**
_PyGreenlet_API
=
NULL
;
#define PyGreenlet_Type (*(PyTypeObject *) _PyGreenlet_API[PyGreenlet_Type_NUM])
# define PyGreenlet_Type \
(*(PyTypeObject*)_PyGreenlet_API[PyGreenlet_Type_NUM])
#define PyExc_GreenletError \
((PyObject *)
_PyGreenlet_API[PyExc_GreenletError_NUM])
#
define PyExc_GreenletError \
((PyObject*)
_PyGreenlet_API[PyExc_GreenletError_NUM])
#define PyExc_GreenletExit \
((PyObject *)
_PyGreenlet_API[PyExc_GreenletExit_NUM])
#
define PyExc_GreenletExit \
((PyObject*)
_PyGreenlet_API[PyExc_GreenletExit_NUM])
/*
* PyGreenlet_New(PyObject *args)
*
* greenlet.greenlet(run, parent=None)
*/
#
define PyGreenlet_New
\
(* (PyGreenlet * (*)(PyObject *run, PyGreenlet *
parent)) \
#
define PyGreenlet_New
\
(*(PyGreenlet * (*)(PyObject * run, PyGreenlet *
parent)) \
_PyGreenlet_API[PyGreenlet_New_NUM])
/*
...
...
@@ -102,8 +88,8 @@ static void **_PyGreenlet_API = NULL;
*
* greenlet.getcurrent()
*/
#define PyGreenlet_GetCurrent \
(*
(PyGreenlet * (*)(void)) _PyGreenlet_API[PyGreenlet_GetCurrent_NUM])
#
define PyGreenlet_GetCurrent \
(*
(PyGreenlet * (*)(void)) _PyGreenlet_API[PyGreenlet_GetCurrent_NUM])
/*
* PyGreenlet_Throw(
...
...
@@ -114,9 +100,11 @@ static void **_PyGreenlet_API = NULL;
*
* g.throw(...)
*/
#define PyGreenlet_Throw \
(* (PyObject * (*) \
(PyGreenlet *self, PyObject *typ, PyObject *val, PyObject *tb)) \
# define PyGreenlet_Throw \
(*(PyObject * (*)(PyGreenlet * self, \
PyObject * typ, \
PyObject * val, \
PyObject * tb)) \
_PyGreenlet_API[PyGreenlet_Throw_NUM])
/*
...
...
@@ -124,8 +112,9 @@ static void **_PyGreenlet_API = NULL;
*
* g.switch(*args, **kwargs)
*/
#define PyGreenlet_Switch \
(* (PyObject * (*)(PyGreenlet *greenlet, PyObject *args, PyObject *kwargs)) \
# define PyGreenlet_Switch \
(*(PyObject * \
(*)(PyGreenlet * greenlet, PyObject * args, PyObject * kwargs)) \
_PyGreenlet_API[PyGreenlet_Switch_NUM])
/*
...
...
@@ -133,32 +122,18 @@ static void **_PyGreenlet_API = NULL;
*
* g.parent = new_parent
*/
#
define PyGreenlet_SetParent
\
(* (int (*)(PyGreenlet *greenlet, PyGreenlet *
nparent)) \
#
define PyGreenlet_SetParent
\
(*(int (*)(PyGreenlet * greenlet, PyGreenlet *
nparent)) \
_PyGreenlet_API[PyGreenlet_SetParent_NUM])
/* Macro that imports greenlet and initializes C API */
#ifdef GREENLET_USE_PYCAPSULE
#define PyGreenlet_Import() \
{ \
/* NOTE: This has actually moved to ``greenlet._greenlet._C_API``, but we
keep the older definition to be sure older code that might have a copy of
the header still works. */
# define PyGreenlet_Import() \
{ \
_PyGreenlet_API = (void**)PyCapsule_Import("greenlet._C_API", 0); \
}
#else
#define PyGreenlet_Import() \
{ \
PyObject *module = PyImport_ImportModule("greenlet"); \
if (module != NULL) { \
PyObject *c_api_object = PyObject_GetAttrString( \
module, "_C_API"); \
if (c_api_object != NULL && PyCObject_Check(c_api_object)) { \
_PyGreenlet_API = \
(void **) PyCObject_AsVoidPtr(c_api_object); \
Py_DECREF(c_api_object); \
} \
Py_DECREF(module); \
} \
}
#endif
}
#endif
/* GREENLET_MODULE */
...
...
pyproject.toml
View file @
e8c18b79
...
...
@@ -26,7 +26,7 @@ requires = [
# 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.
"greenlet >= 0.4.17 ; platform_python_implementation == 'CPython'"
,
"greenlet >= 0.4.17
, < 2.0
; platform_python_implementation == 'CPython'"
,
]
[tool.towncrier]
...
...
setup.py
View file @
e8c18b79
...
...
@@ -192,8 +192,10 @@ greenlet_requires = [
# We need to watch our greenlet version fairly carefully,
# since we compile cython code that extends the greenlet object.
# Binary compatibility would break if the greenlet struct changes.
# (Which it did in 0.4.14 for Python 3.7)
'greenlet >= 0.4.17; platform_python_implementation=="CPython"'
,
# (Which it did in 0.4.14 for Python 3.7 and again in 0.4.17; with
# the release of 1.0a1 it began promising ABI stability with SemVer
# so we can add an upper bound)
'greenlet >= 0.4.17, < 2.0; platform_python_implementation=="CPython"'
,
]
# Note that we don't add cffi to install_requires, it's
...
...
src/gevent/tests/test__util.py
View file @
e8c18b79
...
...
@@ -148,6 +148,10 @@ class TestTree(greentest.TestCase):
value
=
value
.
replace
(
'ref=-1'
,
'ref=0'
)
value
=
value
.
replace
(
"type.current_tree"
,
'GreenletTree.current_tree'
)
value
=
value
.
replace
(
'gevent.tests.__main__.MyLocal'
,
'__main__.MyLocal'
)
# The repr in CPython greenlet 1.0a1 added extra info
value
=
value
.
replace
(
'(otid=X) '
,
''
)
value
=
value
.
replace
(
' dead>'
,
'>'
)
value
=
value
.
replace
(
' current active started main>'
,
'>'
)
return
value
@
greentest
.
ignores_leakcheck
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment