From dda2aa1494b54e4482982313eda01113c2d84de7 Mon Sep 17 00:00:00 2001 From: Hendrik Muhs Date: Sun, 26 Oct 2025 09:16:59 +0100 Subject: [PATCH 1/4] enable free threading --- python/setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/python/setup.py b/python/setup.py index 03a0bb890..30903cce1 100644 --- a/python/setup.py +++ b/python/setup.py @@ -400,7 +400,7 @@ class build_ext(custom_opts, build_cxx): } for e in ext_modules: - e.cython_directives = {"embedsignature": True} + e.cython_directives = {"embedsignature": True, "freethreading_compatible": True} write_version_file() setup( From 792701b37c59a7f5799705185fd0c0d4faf23ff4 Mon Sep 17 00:00:00 2001 From: Hendrik Muhs Date: Sun, 26 Oct 2025 17:46:32 +0100 Subject: [PATCH 2/4] enable freethreading --- python/setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/python/setup.py b/python/setup.py index 30903cce1..069151cb9 100644 --- a/python/setup.py +++ b/python/setup.py @@ -92,7 +92,7 @@ def generate_pykeyvi_source(): try: import autowrap.Main - autowrap.Main.run(pxds, addons, [converters], pykeyvi_pyx) + autowrap.Main.run(pxds, addons, [converters], pykeyvi_pyx, extra_opts={"compiler_directives":{"freethreading_compatible": True}}) # rewrite generated cpp to use std::shared_ptr instead of boost::shared_ptr with open(pykeyvi_cpp, "rt") as fin: with open(pykeyvi_p_cpp, "wt") as fout: From d39e206b401408de388a592b0bbec54a6a4c927e Mon Sep 17 00:00:00 2001 From: Hendrik Muhs Date: Sun, 26 Oct 2025 17:46:44 +0100 Subject: [PATCH 3/4] Revert "enable free threading" This reverts commit dda2aa1494b54e4482982313eda01113c2d84de7. --- python/setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/python/setup.py b/python/setup.py index 069151cb9..2b849524b 100644 --- a/python/setup.py +++ b/python/setup.py @@ -400,7 +400,7 @@ class build_ext(custom_opts, build_cxx): } for e in ext_modules: - e.cython_directives = {"embedsignature": True, "freethreading_compatible": True} + e.cython_directives = {"embedsignature": True} write_version_file() setup( From bcf351fbfc26e7de6d394e09fe04ba74346888ab Mon Sep 17 00:00:00 2001 From: Hendrik Muhs Date: Sun, 26 Oct 2025 18:51:22 +0100 Subject: [PATCH 4/4] pre-commit --- python/setup.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/python/setup.py b/python/setup.py index 2b849524b..75b125af0 100644 --- a/python/setup.py +++ b/python/setup.py @@ -92,7 +92,13 @@ def generate_pykeyvi_source(): try: import autowrap.Main - autowrap.Main.run(pxds, addons, [converters], pykeyvi_pyx, extra_opts={"compiler_directives":{"freethreading_compatible": True}}) + autowrap.Main.run( + pxds, + addons, + [converters], + pykeyvi_pyx, + extra_opts={"compiler_directives": {"freethreading_compatible": True}}, + ) # rewrite generated cpp to use std::shared_ptr instead of boost::shared_ptr with open(pykeyvi_cpp, "rt") as fin: with open(pykeyvi_p_cpp, "wt") as fout: