diff --git a/Cargo.toml b/Cargo.toml index b6208cb..d2eaa0e 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -10,5 +10,5 @@ name = "mizu" crate-type = ["cdylib"] [dependencies] -pyo3 = { version = "0.20.0", features = ["extension-module"] } +pyo3 = { version = "0.21.2", features = ["extension-module"] } pulldown-cmark = "0.10.3" diff --git a/src/core.rs b/src/core.rs index 94f570c..94729a1 100644 --- a/src/core.rs +++ b/src/core.rs @@ -8,7 +8,6 @@ use pulldown_cmark::{html, Options, Parser}; /// Args: /// options (Options): Options for parser. #[pyclass] -#[pyo3(text_signature = "(options, loop/)")] pub struct Mizu { options: Options, loop_: Option, @@ -36,7 +35,7 @@ impl Mizu { /// /// Args: /// text (str): Markdown text. - #[pyo3(text_signature = "(text, /)", signature = (text))] + #[pyo3(signature = (text))] fn parse(&self, text: &str) -> PyResult { let parser: Parser = Parser::new_ext(text, self.options); @@ -49,6 +48,7 @@ impl Mizu { /// /// Args: /// text (str): Markdown text + #[pyo3(signature = (text))] fn aioparse(&self, py: Python, text: String) -> PyResult { if self.loop_.is_none() { return Err(pyo3::exceptions::PyValueError::new_err( @@ -71,7 +71,7 @@ impl Mizu { } } -fn get_options(ob: &PyAny) -> PyResult { +fn get_options(ob: &Bound<'_, PyAny>) -> PyResult { let mut options: Options = Options::empty(); if ob.getattr("tables")?.extract::()? { options.insert(Options::ENABLE_TABLES); diff --git a/src/lib.rs b/src/lib.rs index 2d350da..80416b5 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -4,7 +4,7 @@ mod core; /// Mizu's core #[pymodule] -fn mizu(_py: Python, m: &PyModule) -> PyResult<()> { +fn mizu(_py: Python, m: &Bound<'_, PyModule>) -> PyResult<()> { m.add_class::()?; Ok(()) }