Skip to content

Commit cd03504

Browse files
bschoenmaeckersdavidhewitt
authored andcommitted
Bumped pyo3 dependency to v0.22.0
1 parent cf9b967 commit cd03504

File tree

4 files changed

+10
-5
lines changed

4 files changed

+10
-5
lines changed

Cargo.toml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,16 @@ num-complex = ">= 0.2, < 0.5"
2222
num-integer = "0.1"
2323
num-traits = "0.2"
2424
ndarray = ">= 0.15, < 0.17"
25-
pyo3 = { version = "0.21.0", default-features = false, features = ["macros"] }
25+
pyo3 = { version = "0.22.0", default-features = false, features = ["macros"] }
2626
rustc-hash = "1.1"
2727

2828
[dev-dependencies]
29-
pyo3 = { version = "0.21.0", default-features = false, features = ["auto-initialize"] }
29+
pyo3 = { version = "0.22.0", default-features = false, features = ["auto-initialize"] }
3030
nalgebra = { version = "0.32", default-features = false, features = ["std"] }
3131

3232
[package.metadata.docs.rs]
3333
all-features = true
34+
35+
[features]
36+
default = ["gil-refs"]
37+
"gil-refs" = ["pyo3/gil-refs"]

src/datetime.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -243,7 +243,7 @@ impl TypeDescriptors {
243243
}
244244
};
245245

246-
dtype.clone().into_bound(py)
246+
dtype.bind(py).to_owned()
247247
}
248248
}
249249

src/dtype.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -825,6 +825,7 @@ mod tests {
825825
use super::*;
826826

827827
use pyo3::{py_run, types::PyTypeMethods};
828+
use pyo3::types::PyString;
828829

829830
use crate::npyffi::{is_numpy_2, NPY_NEEDS_PYAPI};
830831

@@ -851,7 +852,7 @@ mod tests {
851852

852853
#[test]
853854
fn test_dtype_names() {
854-
fn type_name<'py, T: Element>(py: Python<'py>) -> String {
855+
fn type_name<T: Element>(py: Python) -> Bound<PyString> {
855856
dtype_bound::<T>(py).typeobj().qualname().unwrap()
856857
}
857858
Python::with_gil(|py| {

src/strings.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,7 @@ impl TypeDescriptors {
191191
}
192192
};
193193

194-
dtype.clone().into_bound(py)
194+
dtype.bind(py).to_owned()
195195
}
196196
}
197197

0 commit comments

Comments
 (0)