Skip to content

Commit acaa00e

Browse files
committed
Remove support for Python 3.7 and 3.8
Github actions forced our hand by dropping 3.7 itself, and 3.8 was announced to be removed in the next release.
1 parent 686c208 commit acaa00e

File tree

7 files changed

+7
-245
lines changed

7 files changed

+7
-245
lines changed

.github/workflows/tests.yml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,13 +25,11 @@ jobs:
2525
runs-on: ${{ matrix.os }}
2626
strategy:
2727
matrix:
28-
python-version: [3.7, 3.8, 3.9, "3.10", "3.11", "3.12", "3.13"]
28+
python-version: [3.9, "3.10", "3.11", "3.12", "3.13"]
2929
os: [ubuntu-latest]
3030
include:
3131
# Needs to be all supported Python versions, they upload the built
3232
# wheels for releases.
33-
- os: macos-latest
34-
python-version: 3.8
3533
- os: macos-latest
3634
python-version: 3.9
3735
- os: macos-latest

CHANGES.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@
22
Changes
33
=========
44

5-
3.1.2 (unreleased)
5+
3.2.0 (unreleased)
66
==================
77

8-
- Nothing changed yet.
8+
- Remove support for Python 3.7 and 3.8.
99

1010

1111
3.1.1 (2024-09-20)

appveyor.yml

Lines changed: 1 addition & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -69,17 +69,6 @@ environment:
6969
PYTHON_EXE: python
7070

7171

72-
- PYTHON: "C:\\Python38-x64"
73-
PYTHON_ARCH: "64"
74-
PYTHON_VERSION: "3.8.x"
75-
PYTHON_EXE: python
76-
77-
78-
- PYTHON: "C:\\Python37-x64"
79-
PYTHON_ARCH: "64"
80-
PYTHON_VERSION: "3.7.x"
81-
PYTHON_EXE: python
82-
8372

8473
# Tested 32-bit versions. A small, hand-picked selection covering
8574
# important variations. No need to include newer versions of
@@ -100,17 +89,7 @@ environment:
10089
# Untested 32-bit versions. As above, we don't expect any variance
10190
# from the tested 32-bit versions, OR they are very EOL.
10291

103-
- PYTHON: "C:\\Python38"
104-
PYTHON_ARCH: "32"
105-
PYTHON_VERSION: "3.8.x"
106-
PYTHON_EXE: python
107-
GWHEEL_ONLY: true
108-
109-
- PYTHON: "C:\\Python37"
110-
PYTHON_ARCH: "32"
111-
PYTHON_VERSION: "3.7.x"
112-
PYTHON_EXE: python
113-
GWHEEL_ONLY: true
92+
# None right now.
11493

11594

11695

make-manylinux

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ if [ -d /greenlet -a -d /opt/python ]; then
3535
which auditwheel
3636
echo "Installed Python versions"
3737
ls -l /opt/python
38-
for variant in `ls -d /opt/python/cp{313,37,38,39,310,311,312}*`; do
38+
for variant in `ls -d /opt/python/cp{313,39,310,311,312}*`; do
3939
if [ "$variant" = "/opt/python/cp313-313t" ]; then
4040
echo "Skipping no-gil build. The GIL is required."
4141
continue

setup.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -241,8 +241,6 @@ def get_greenlet_version():
241241
'Programming Language :: Python',
242242
'Programming Language :: Python :: 3',
243243
'Programming Language :: Python :: 3 :: Only',
244-
'Programming Language :: Python :: 3.7',
245-
'Programming Language :: Python :: 3.8',
246244
'Programming Language :: Python :: 3.9',
247245
'Programming Language :: Python :: 3.10',
248246
'Programming Language :: Python :: 3.11',
@@ -261,6 +259,6 @@ def get_greenlet_version():
261259
'psutil',
262260
],
263261
},
264-
python_requires=">=3.7",
262+
python_requires=">=3.9",
265263
zip_safe=False,
266264
)

src/greenlet/TThreadStateDestroy.cpp

Lines changed: 1 addition & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
#include "TGreenlet.hpp"
1616

1717
#include "greenlet_thread_support.hpp"
18-
#include "greenlet_cpython_add_pending.hpp"
1918
#include "greenlet_compiler_compat.hpp"
2019
#include "TGreenletGlobals.cpp"
2120
#include "TThreadState.hpp"
@@ -168,47 +167,7 @@ struct ThreadState_DestroyNoGIL
168167
delete state; // Deleting this runs the destructor, DECREFs the main greenlet.
169168
}
170169

171-
// ensure this is actually defined.
172-
static_assert(GREENLET_BROKEN_PY_ADD_PENDING == 1 || GREENLET_BROKEN_PY_ADD_PENDING == 0,
173-
"GREENLET_BROKEN_PY_ADD_PENDING not defined correctly.");
174170

175-
#if GREENLET_BROKEN_PY_ADD_PENDING
176-
static int _push_pending_call(struct _pending_calls *pending,
177-
int (*func)(void *), void *arg)
178-
{
179-
int i = pending->last;
180-
int j = (i + 1) % NPENDINGCALLS;
181-
if (j == pending->first) {
182-
return -1; /* Queue full */
183-
}
184-
pending->calls[i].func = func;
185-
pending->calls[i].arg = arg;
186-
pending->last = j;
187-
return 0;
188-
}
189-
190-
static int AddPendingCall(int (*func)(void *), void *arg)
191-
{
192-
_PyRuntimeState *runtime = &_PyRuntime;
193-
if (!runtime) {
194-
// obviously impossible
195-
return 0;
196-
}
197-
struct _pending_calls *pending = &runtime->ceval.pending;
198-
if (!pending->lock) {
199-
return 0;
200-
}
201-
int result = 0;
202-
PyThread_acquire_lock(pending->lock, WAIT_LOCK);
203-
if (!pending->finishing) {
204-
result = _push_pending_call(pending, func, arg);
205-
}
206-
PyThread_release_lock(pending->lock);
207-
SIGNAL_PENDING_CALLS(&runtime->ceval);
208-
return result;
209-
}
210-
#else
211-
// Python < 3.8 or >= 3.9
212171
static int AddPendingCall(int (*func)(void*), void* arg)
213172
{
214173
// If the interpreter is in the middle of finalizing, we can't add a
@@ -234,7 +193,7 @@ struct ThreadState_DestroyNoGIL
234193
}
235194
return Py_AddPendingCall(func, arg);
236195
}
237-
#endif
196+
238197

239198

240199

src/greenlet/greenlet_cpython_add_pending.hpp

Lines changed: 0 additions & 172 deletions
This file was deleted.

0 commit comments

Comments
 (0)