Skip to content

Support free-threaded Python and ship 3.13t wheels #1767

Closed
@ngoldbaum

Description

@ngoldbaum

It looks like when I build tokenizers on a free-threaded Python, it chokes because of a dependency on rust-numpy 0.23.

If I manually update the dependencies on pyo3 and rust-numpy:

diff --git a/bindings/python/Cargo.toml b/bindings/python/Cargo.toml
index 6e8b0c34..3dfdf2ca 100644
--- a/bindings/python/Cargo.toml
+++ b/bindings/python/Cargo.toml
@@ -14,8 +14,8 @@ serde = { version = "1.0", features = ["rc", "derive"] }
 serde_json = "1.0"
 libc = "0.2"
 env_logger = "0.11"
-pyo3 = { version = "0.23", features = ["abi3", "abi3-py39", "py-clone"] }
-numpy = "0.23"
+pyo3 = { version = "0.24", features = ["abi3", "abi3-py39", "py-clone"] }
+numpy = "0.24"
 ndarray = "0.16"
 itertools = "0.12"
 
@@ -24,7 +24,7 @@ path = "../../tokenizers"
 
 [dev-dependencies]
 tempfile = "3.10"
-pyo3 = { version = "0.23", features = ["auto-initialize"] }
+pyo3 = { version = "0.24", features = ["auto-initialize"] }
 
 [features]
 defaut = ["pyo3/extension-module"]

Then everything builds. I didn't try running the tests or anything else beyond that.

I'm a PyO3 maintainer and helped initially add support for the free-threaded build in PyO3. Happy to help out with adding support here.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions