Skip to content

Commit 8ef71f9

Browse files
committed
add support for free-threaded python 3.14
1 parent 71ae766 commit 8ef71f9

3 files changed

Lines changed: 15 additions & 3 deletions

File tree

.github/workflows/actions.yaml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ jobs:
77
strategy:
88
matrix:
99
os: [ ubuntu-latest, macos-latest ]
10-
python-version: ['3.9', '3.10', '3.11', '3.12', '3.13', '3.14', 'pypy3.11']
10+
python-version: ['3.9', '3.10', '3.11', '3.12', '3.13', '3.14', '3.14t', 'pypy3.10', 'pypy3.11']
1111
tarantool: ['1.10', '2', '3']
1212
exclude:
1313
- os: macos-latest
@@ -16,6 +16,8 @@ jobs:
1616
tarantool: '2'
1717
- python-version: 'pypy3.10'
1818
tarantool: '1.10'
19+
- python-version: 'pypy3.11'
20+
tarantool: '1.10'
1921

2022
runs-on: ${{ matrix.os }}
2123

@@ -100,13 +102,15 @@ jobs:
100102
run: uv tool install build
101103

102104
- name: Build source archive
105+
if: matrix.os == 'ubuntu-latest'
103106
run: |
104107
pyproject-build -s .
105108
106109
- name: Build wheels
107110
run: cibuildwheel --output-dir dist
108111
env:
109-
CIBW_BUILD: "cp39-* cp310-* cp311-* cp312-* cp313-* cp314-* pp311-*"
112+
CIBW_ENABLE: pypy pypy-eol
113+
CIBW_BUILD: "cp39-* cp310-* cp311-* cp312-* cp313-* cp314-* cp314t-* pp310-* pp311-*"
110114

111115
- uses: actions/upload-artifact@v4
112116
with:

asynctnt/iproto/protocol.pyx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
# cython: language_level=3
2+
# cython: freethreading_compatible=True
23

34
cimport cpython.dict
45
from cpython.datetime cimport import_datetime

asynctnt/iproto/tupleobj/tupleobj.c

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,10 @@
1212
static PyObject *ttuple_iter(PyObject *);
1313
static PyObject *ttuple_new_items_iter(PyObject *);
1414

15+
#ifndef Py_GIL_DISABLED
1516
static AtntTupleObject *free_list[AtntTuple_MAXSAVESIZE];
1617
static int numfree[AtntTuple_MAXSAVESIZE];
18+
#endif
1719

1820

1921
PyObject *
@@ -31,12 +33,15 @@ AtntTuple_New(PyObject *metadata, Py_ssize_t size)
3133
return NULL;
3234
}
3335

36+
#ifndef Py_GIL_DISABLED
3437
if (size < AtntTuple_MAXSAVESIZE && (o = free_list[size]) != NULL) {
3538
free_list[size] = (AtntTupleObject *) o->ob_item[0];
3639
numfree[size]--;
3740
_Py_NewReference((PyObject *)o);
3841
}
39-
else {
42+
else
43+
#endif
44+
{
4045
/* Check for overflow */
4146
if ((size_t)size > ((size_t)PY_SSIZE_T_MAX - sizeof(AtntTupleObject) -
4247
sizeof(PyObject *)) / sizeof(PyObject *)) {
@@ -79,6 +84,7 @@ ttuple_dealloc(AtntTupleObject *o)
7984
Py_CLEAR(o->ob_item[i]);
8085
}
8186

87+
#ifndef Py_GIL_DISABLED
8288
if (len < AtntTuple_MAXSAVESIZE &&
8389
numfree[len] < AtntTuple_MAXFREELIST &&
8490
AtntTuple_CheckExact(o))
@@ -88,6 +94,7 @@ ttuple_dealloc(AtntTupleObject *o)
8894
free_list[len] = o;
8995
goto done; /* return */
9096
}
97+
#endif
9198
}
9299
Py_TYPE(o)->tp_free((PyObject *)o);
93100
done:

0 commit comments

Comments
 (0)