From 33badf14f235ec832865949dc8dabba60d56939f Mon Sep 17 00:00:00 2001 From: Marco Barbosa Date: Wed, 17 Jun 2026 23:44:05 +0000 Subject: [PATCH 1/2] annotates .pyx cython files as compatible with freethreading python --- src/h3/_cy/cells.pyx | 1 + src/h3/_cy/edges.pyx | 1 + src/h3/_cy/error_system.pyx | 1 + src/h3/_cy/latlng.pyx | 1 + src/h3/_cy/memory.pyx | 1 + src/h3/_cy/to_multipoly.pyx | 1 + src/h3/_cy/util.pyx | 1 + src/h3/_cy/vertex.pyx | 1 + 8 files changed, 8 insertions(+) diff --git a/src/h3/_cy/cells.pyx b/src/h3/_cy/cells.pyx index 78d256130..8b84f9d7d 100644 --- a/src/h3/_cy/cells.pyx +++ b/src/h3/_cy/cells.pyx @@ -1,3 +1,4 @@ +# cython: freethreading_compatible=True cimport h3lib from .h3lib cimport bool, int64_t, H3int, H3ErrorCodes diff --git a/src/h3/_cy/edges.pyx b/src/h3/_cy/edges.pyx index bd0aa7c00..1d2ef74e2 100644 --- a/src/h3/_cy/edges.pyx +++ b/src/h3/_cy/edges.pyx @@ -1,3 +1,4 @@ +# cython: freethreading_compatible=True cimport h3lib from .h3lib cimport bool, H3int diff --git a/src/h3/_cy/error_system.pyx b/src/h3/_cy/error_system.pyx index fc18f4672..5fe5cd99e 100644 --- a/src/h3/_cy/error_system.pyx +++ b/src/h3/_cy/error_system.pyx @@ -1,3 +1,4 @@ +# cython: freethreading_compatible=True """ Exceptions from the h3-py library have three possible sources: diff --git a/src/h3/_cy/latlng.pyx b/src/h3/_cy/latlng.pyx index d83a9d3d8..1593d43b2 100644 --- a/src/h3/_cy/latlng.pyx +++ b/src/h3/_cy/latlng.pyx @@ -1,3 +1,4 @@ +# cython: freethreading_compatible=True from libc.stdint cimport uint64_t cimport h3lib diff --git a/src/h3/_cy/memory.pyx b/src/h3/_cy/memory.pyx index 0852105fe..963b00d6a 100644 --- a/src/h3/_cy/memory.pyx +++ b/src/h3/_cy/memory.pyx @@ -1,3 +1,4 @@ +# cython: freethreading_compatible=True from cython.view cimport array from .h3lib cimport H3int diff --git a/src/h3/_cy/to_multipoly.pyx b/src/h3/_cy/to_multipoly.pyx index ed3e76371..cb5e5e240 100644 --- a/src/h3/_cy/to_multipoly.pyx +++ b/src/h3/_cy/to_multipoly.pyx @@ -1,3 +1,4 @@ +# cython: freethreading_compatible=True cimport h3lib from h3lib cimport H3int from .util cimport check_cell, coord2deg diff --git a/src/h3/_cy/util.pyx b/src/h3/_cy/util.pyx index 9b070f9c1..06823d000 100644 --- a/src/h3/_cy/util.pyx +++ b/src/h3/_cy/util.pyx @@ -1,3 +1,4 @@ +# cython: freethreading_compatible=True from .h3lib cimport ( H3int, H3str, diff --git a/src/h3/_cy/vertex.pyx b/src/h3/_cy/vertex.pyx index 26a674af5..99cc5ef1f 100644 --- a/src/h3/_cy/vertex.pyx +++ b/src/h3/_cy/vertex.pyx @@ -1,3 +1,4 @@ +# cython: freethreading_compatible=True cimport h3lib from h3lib cimport bool, H3int From 1ed3273533d62a7fe61dbf4fbb35c08e4f3b0599 Mon Sep 17 00:00:00 2001 From: Marco Barbosa Date: Thu, 18 Jun 2026 00:04:12 +0000 Subject: [PATCH 2/2] adds trove for python free threading and changelog --- CHANGELOG.md | 1 + pyproject.toml | 1 + 2 files changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 651c76c40..7ad11bf67 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -15,6 +15,7 @@ avoid adding features or APIs which do not map onto the [H3 core API](https://uber.github.io/h3/#/documentation/api-reference/). ## Unreleased +- Fix wheels for Python 3.14.6 free-threading ## [4.5.0] - 2026-05-29 diff --git a/pyproject.toml b/pyproject.toml index f3304b902..2474f889f 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -30,6 +30,7 @@ classifiers = [ 'Programming Language :: Python :: 3.12', 'Programming Language :: Python :: 3.13', 'Programming Language :: Python :: 3.14', + 'Programming Language :: Python :: Free Threading', 'Operating System :: MacOS :: MacOS X', 'Operating System :: POSIX :: Linux', 'Operating System :: Microsoft :: Windows',