From 2c9e304a2f48d8f3fddbfc9ebfc4d9916c0eeeb7 Mon Sep 17 00:00:00 2001 From: Ralf Gommers Date: Wed, 27 Nov 2024 14:20:52 +0100 Subject: [PATCH] MAINT: declare that `highspy._core` supports free-threaded CPython This allows `highspy` to be imported in a free-threaded CPython (see PEP 703) interpreter without raising a warning and re-enabling the GIL. We've tested thread-safety of this extension module reasonably well in SciPy now, and everything seems fine on all tested platforms (Linux, macOS, Windows and x86-64/arm64). --- src/highs_bindings.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/highs_bindings.cpp b/src/highs_bindings.cpp index 64db9172d3..5b4069a96c 100644 --- a/src/highs_bindings.cpp +++ b/src/highs_bindings.cpp @@ -642,7 +642,7 @@ HighsStatus highs_setCallback( data.ptr()); } -PYBIND11_MODULE(_core, m) { +PYBIND11_MODULE(_core, m, py::mod_gil_not_used()) { // To keep a smaller diff, for reviewers, the declarations are not moved, but // keep in mind: // C++ enum classes :: don't need .export_values()