From 0f776b8e6dcdd61e0eaef928dc3e7ded103cee3d Mon Sep 17 00:00:00 2001 From: Dirkjan Ochtman Date: Mon, 29 Aug 2022 16:24:37 +0200 Subject: [PATCH] Upgrade to PyO3 0.17 --- instant-segment-py/Cargo.toml | 2 +- instant-segment-py/src/lib.rs | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/instant-segment-py/Cargo.toml b/instant-segment-py/Cargo.toml index 5d167dd..e21251c 100644 --- a/instant-segment-py/Cargo.toml +++ b/instant-segment-py/Cargo.toml @@ -18,7 +18,7 @@ crate-type = ["cdylib"] ahash = "0.8" bincode = "1.3.2" instant-segment = { version = "0.10", path = "../instant-segment", features = ["with-serde"] } -pyo3 = { version = "0.16", features = ["extension-module"] } +pyo3 = { version = "0.17.1", features = ["extension-module"] } smartstring = "1" [package.metadata.maturin] diff --git a/instant-segment-py/src/lib.rs b/instant-segment-py/src/lib.rs index ff24769..d29633b 100644 --- a/instant-segment-py/src/lib.rs +++ b/instant-segment-py/src/lib.rs @@ -5,13 +5,14 @@ use std::fs::File; use std::io::{BufReader, BufWriter}; use pyo3::exceptions::PyValueError; -use pyo3::proc_macro::{pyclass, pymethods, pymodule}; use pyo3::types::{PyIterator, PyModule}; +use pyo3::{pyclass, pymethods, pymodule}; use pyo3::{PyErr, PyRef, PyRefMut, PyResult, Python}; use smartstring::alias::String as SmartString; #[pymodule] -fn instant_segment(_: Python, m: &PyModule) -> PyResult<()> { +#[pyo3(name = "instant_segment")] +fn instant_segment_py(_: Python, m: &PyModule) -> PyResult<()> { m.add_class::()?; m.add_class::()?; Ok(())