Skip to content

Commit

Permalink
MAINT: declare that highspy._core supports free-threaded CPython
Browse files Browse the repository at this point in the history
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).
  • Loading branch information
rgommers committed Nov 27, 2024
1 parent b8431c5 commit 3988266
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/highs_bindings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -638,7 +638,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()
Expand Down

0 comments on commit 3988266

Please sign in to comment.