From 930149f6d08f0a285354dab31dd200f6b781f116 Mon Sep 17 00:00:00 2001 From: "Peter M. Stahl" Date: Fri, 5 Jul 2024 17:07:20 +0200 Subject: [PATCH] Migrate Python module to PyO3 0.22.0 --- requirements.txt | 4 ++-- src/python.rs | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/requirements.txt b/requirements.txt index c3ee8d0..3411030 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,2 +1,2 @@ -maturin == 1.4.0 -pytest == 8.0.2 +maturin == 1.6.0 +pytest == 8.2.2 diff --git a/src/python.rs b/src/python.rs index 2dbcd70..2f20d20 100644 --- a/src/python.rs +++ b/src/python.rs @@ -26,7 +26,7 @@ use pyo3::types::PyType; use regex::{Captures, Regex}; #[pymodule] -fn grex(_py: Python<'_>, m: &PyModule) -> PyResult<()> { +fn grex(m: &Bound<'_, PyModule>) -> PyResult<()> { m.add_class::()?; Ok(()) } @@ -55,7 +55,7 @@ impl RegExpBuilder { /// Raises: /// ValueError: if `test_cases` is empty #[classmethod] - fn from_test_cases(_cls: &PyType, test_cases: Vec) -> PyResult { + fn from_test_cases(_cls: &Bound, test_cases: Vec) -> PyResult { Self::new(test_cases) }