From 86bd529d62ffc6bcd492d40bdf1900e5eee9c244 Mon Sep 17 00:00:00 2001 From: Robin van der Noord Date: Fri, 31 Oct 2025 12:16:16 +0100 Subject: [PATCH] fix: bump pyo3 and serde-pyobject to versions that support Python 3.14, add type hint required to compile with new versions --- Cargo.toml | 4 ++-- src/python_bindings/mod.rs | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 33df5205..a15d586c 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -10,9 +10,9 @@ rust-version = "1.85.0" [dependencies] once_cell = "1.20" thiserror = "2.0" -pyo3 = { version = "0.24", features = ["extension-module"], optional = true } +pyo3 = { version = "0.27", features = ["extension-module"], optional = true } regex = "1.10.6" -serde-pyobject = { version = "0.6.1", optional = true } +serde-pyobject = { version = "0.8.0", optional = true } serde_json = { version = "1.0", features = ["preserve_order"] } serde = {version = "1.0", features = ["derive"]} bincode = "2.0.1" diff --git a/src/python_bindings/mod.rs b/src/python_bindings/mod.rs index f83a454d..fbaea11c 100644 --- a/src/python_bindings/mod.rs +++ b/src/python_bindings/mod.rs @@ -506,7 +506,7 @@ fn register_child_module(parent_module: &Bound<'_, PyModule>) -> PyResult<()> { m.add_function(wrap_pyfunction!(build_regex_from_schema_py, &m)?)?; let sys = PyModule::import(m.py(), "sys")?; - let sys_modules_bind = sys.as_ref().getattr("modules")?; + let sys_modules_bind = (sys.as_ref() as &Bound).getattr("modules")?; let sys_modules = sys_modules_bind.downcast::()?; sys_modules.set_item("outlines_core.json_schema", &m)?;