diff --git a/.github/workflows/unit-tests.yml b/.github/workflows/unit-tests.yml index ddb6ecbe83126..a9585c17454fb 100644 --- a/.github/workflows/unit-tests.yml +++ b/.github/workflows/unit-tests.yml @@ -388,8 +388,6 @@ jobs: - name: Run Tests uses: ./.github/actions/run-tests - env: - PYTHON_GIL: 0 # NOTE: this job must be kept in sync with the Pyodide build job in wheels.yml emscripten: diff --git a/meson.build b/meson.build index 06623a305ab54..efe543b7a267c 100644 --- a/meson.build +++ b/meson.build @@ -44,6 +44,11 @@ else meson.add_dist_script(py, versioneer, '-o', '_version_meson.py') endif +cy = meson.get_compiler('cython') +if cy.version().version_compare('>=3.1.0') + add_project_arguments('-Xfreethreading_compatible=true', language : 'cython') +endif + # Needed by pandas.test() when it looks for the pytest ini options py.install_sources( 'pyproject.toml', diff --git a/pandas/_libs/src/vendored/ujson/python/ujson.c b/pandas/_libs/src/vendored/ujson/python/ujson.c index 075411a23b075..f369d122a3dbe 100644 --- a/pandas/_libs/src/vendored/ujson/python/ujson.c +++ b/pandas/_libs/src/vendored/ujson/python/ujson.c @@ -384,6 +384,10 @@ PyMODINIT_FUNC PyInit_json(void) { return NULL; } +#ifdef Py_GIL_DISABLED + PyUnstable_Module_SetGIL(module, Py_MOD_GIL_NOT_USED); +#endif + #ifndef PYPY_VERSION PyObject *mod_decimal = PyImport_ImportModule("decimal"); if (mod_decimal) {