Skip to content

Commit 6f2f852

Browse files
committed
PYTHON-4450 Support free-threaded Python with no-GIL
1 parent 8f32f3c commit 6f2f852

File tree

4 files changed

+9
-1
lines changed

4 files changed

+9
-1
lines changed

.github/workflows/dist.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ jobs:
6767
# Note: the default manylinux is manylinux2014
6868
run: |
6969
python -m pip install -U pip
70-
python -m pip install "cibuildwheel>=2.17,<3"
70+
python -m pip install "cibuildwheel>=2.20,<3"
7171
7272
- name: Build wheels
7373
env:

bson/_cbsonmodule.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3184,6 +3184,9 @@ static PyModuleDef_Slot _cbson_slots[] = {
31843184
{Py_mod_exec, _cbson_exec},
31853185
#if defined(Py_MOD_MULTIPLE_INTERPRETERS_SUPPORTED)
31863186
{Py_mod_multiple_interpreters, Py_MOD_MULTIPLE_INTERPRETERS_SUPPORTED},
3187+
#endif
3188+
#if PY_VERSION_HEX >= 0x030D0000
3189+
{Py_mod_gil, Py_MOD_GIL_NOT_USED},
31873190
#endif
31883191
{0, NULL},
31893192
};

pymongo/_cmessagemodule.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1022,6 +1022,9 @@ static PyModuleDef_Slot _cmessage_slots[] = {
10221022
{Py_mod_exec, _cmessage_exec},
10231023
#ifdef Py_MOD_MULTIPLE_INTERPRETERS_SUPPORTED
10241024
{Py_mod_multiple_interpreters, Py_MOD_MULTIPLE_INTERPRETERS_SUPPORTED},
1025+
#endif
1026+
#if PY_VERSION_HEX >= 0x030D0000
1027+
{Py_mod_gil, Py_MOD_GIL_NOT_USED},
10251028
#endif
10261029
{0, NULL},
10271030
};

pyproject.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -236,6 +236,8 @@ partial_branches = ["if (.*and +)*not _use_c( and.*)*:"]
236236
directory = "htmlcov"
237237

238238
[tool.cibuildwheel]
239+
# Enable free-threaded support
240+
free-threaded-support = true
239241
skip = "pp* *-musllinux*"
240242
build-frontend = "build"
241243
test-command = "python {project}/tools/fail_if_no_c.py"

0 commit comments

Comments
 (0)