From 1e2e51ce03bb101398da8d4eb3e8e2f65456e375 Mon Sep 17 00:00:00 2001 From: aidannewsome Date: Sat, 3 Oct 2026 22:34:34 -0400 Subject: [PATCH] Declare free-threading support, and test on Python 3.14t Triangulation already releases the GIL and guards each instance with its own mutex, so the module is safe without the GIL. Without the declaration, importing PythonCDT on a free-threaded Python turns the GIL back on for the whole process. --- .github/workflows/ci.yml | 2 +- cdt_bindings.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 9071af3..4892186 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -18,7 +18,7 @@ jobs: fail-fast: false matrix: os: [ubuntu-latest, macos-latest, windows-latest] - python-version: ["3.10", "3.13"] + python-version: ["3.10", "3.13", "3.14t"] defaults: run: diff --git a/cdt_bindings.cpp b/cdt_bindings.cpp index bb3b06c..75512c3 100644 --- a/cdt_bindings.cpp +++ b/cdt_bindings.cpp @@ -170,7 +170,7 @@ std::string TriInd2str(CDT::TriInd it) } // namespace -PYBIND11_MODULE(PythonCDT, m) +PYBIND11_MODULE(PythonCDT, m, py::mod_gil_not_used()) { // clang-format off m.doc() = R"pbdoc(