Skip to content

Commit 8767f74

Browse files
committed
python: enable freethreading in nanobind + cibuildwheel (experimental)
1 parent 5064457 commit 8767f74

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

imgui_bundle_cmake/internal/add_imgui_bundle_bindings.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ function(add_imgui_bundle_bindings)
5858
${all_pybind_files}
5959
)
6060

61-
nanobind_add_module(${python_native_module_name} ${python_module_sources})
61+
nanobind_add_module(${python_native_module_name} FREE_THREADED ${python_module_sources})
6262
target_compile_definitions(${python_native_module_name} PRIVATE VERSION_INFO=${PROJECT_VERSION})
6363

6464
litgen_setup_module(${bound_library} ${python_native_module_name} ${python_wrapper_module_name} ${IMGUI_BUNDLE_PATH}/bindings)

pyproject.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,9 @@ build-verbosity = 1
103103
# Target python versions:
104104
build = ["cp312-*", "cp313-*", "cp314-*"]
105105

106+
# Test freethreading support (no GIL)
107+
enable = ["cpython-freethreading"]
108+
106109
# Tests
107110
test-requires = "pytest"
108111
test-command = "pytest {project}/tests" # cibuildwheel doc says pytest {package}/tests !

0 commit comments

Comments
 (0)