From 1ce66de6182552c6b6f497e9bea3a9149763ab3a Mon Sep 17 00:00:00 2001 From: Axel Huebl Date: Fri, 14 Aug 2026 16:34:48 -0700 Subject: [PATCH] `setup.py`: Find Free-Threaded Python (`Python_FIND_ABI`) Disabled by default, but our cibuildwheels includes builds for it now https://github.com/BLAST-ImpactX/impactx-wheels/pull/27 https://cmake.org/cmake/help/latest/module/FindPython.html#variable:Python_FIND_ABI Co-Authored-By: Claude Opus 5 (1M context) --- setup.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/setup.py b/setup.py index 3e15455d8c..f77b0d16b2 100644 --- a/setup.py +++ b/setup.py @@ -60,6 +60,10 @@ def build_extension(self, ext): "-DPython_FIND_VERSION_EXACT=" + ("FALSE" if emscripten else "TRUE"), "-DPython_FIND_STRATEGY=LOCATION", ] + # Free-threaded (PEP 703) gil_disabled is OFF by default + # https://cmake.org/cmake/help/latest/module/FindPython.html#variable:Python_FIND_ABI + if sysconfig.get_config_var("Py_GIL_DISABLED"): + cmake_args.append("-DPython_FIND_ABI=OFF;OFF;OFF;ON") if emscripten: cmake_args += [ "-DPython_INCLUDE_DIR=" + sysconfig.get_config_var("INCLUDEPY")