Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update pyo3 to 0.22.0 (without "py-clone") #435

Merged
merged 31 commits into from
Oct 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
1f4f01b
Bumped pyo3 dependency to v0.22.0
bschoenmaeckers Jun 27, 2024
b6bb822
Update convert.rs
bschoenmaeckers Jun 27, 2024
09944ec
Update sum_products
bschoenmaeckers Jun 27, 2024
e932abd
Update untyped_arrays
bschoenmaeckers Jun 27, 2024
d629579
update dtype
bschoenmaeckers Jun 27, 2024
592ad11
Update array
bschoenmaeckers Jun 27, 2024
2afad9a
Don't enable gil-refs feature by default
bschoenmaeckers Jun 27, 2024
79c85aa
Added `PyClone` trait that will replace `Clone` as supertrait of `Ele…
JRRudy1 Jul 13, 2024
b5c3908
Added `impl_py_clone` macro that provides an efficient `PyClone` impl…
JRRudy1 Jul 13, 2024
4a59849
Added `PyClone` impls for the types in the `strings` module.
JRRudy1 Jul 13, 2024
3d09a87
Added `PyClone` impl for `PyObject`.
JRRudy1 Jul 13, 2024
5660cda
Replaced `Clone` with `PyClone` as a supertrait of `Element`.
JRRudy1 Jul 13, 2024
aa942b0
Updated the private `array::clone_elements` function to require a GIL…
JRRudy1 Jul 13, 2024
f18e06d
Updated methods in the `array` module to call `PyClone` methods inste…
JRRudy1 Jul 13, 2024
d52ce3f
Updated `ToPyArray` impls to call `py_clone` instead of `clone`.
JRRudy1 Jul 13, 2024
e0260bc
Updated `Element` impl for `bf16` to call `py_clone` instead of `clone`.
JRRudy1 Jul 13, 2024
ef8a545
Added necessary "gil-refs" feature gate to the `nalgebra`-specific `P…
JRRudy1 Jul 13, 2024
bfe3a66
Feature-gated the crate-level `deny(missing_debug_implementations)` a…
JRRudy1 Jul 13, 2024
963a28c
Minor tweaks to please the lint gods.
JRRudy1 Jul 13, 2024
fcd5591
Formatting and cleanup.
JRRudy1 Jul 13, 2024
038f8ca
Updated docs to use non-deprecated APIs.
JRRudy1 Jul 13, 2024
fc86b46
Added `PyClone` to the crate's root namespace.
JRRudy1 Jul 14, 2024
d81f0f4
Bumped pyo3 dependency version in the example crates.
JRRudy1 Aug 1, 2024
799c7d8
Fixed example crate attempting to clone a PyObject.
JRRudy1 Aug 1, 2024
690f06c
Bumped the MSRV and PyO3 version in README.md
JRRudy1 Aug 2, 2024
26266ee
Restored deprecation warning for `IntoPyArray::into_pyarray` and `ToP…
JRRudy1 Oct 5, 2024
0c9f6e9
Removed `PyClone` trait, moved it methods to `Element`, and updated i…
JRRudy1 Oct 5, 2024
eca4460
cargo fmt
JRRudy1 Oct 5, 2024
1c42672
Added CHANGELOG entry
JRRudy1 Oct 5, 2024
3e9cad0
restore deprecation messages
davidhewitt Oct 6, 2024
b17fcba
restore allow deprecated
davidhewitt Oct 6, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
- Bump MSRV to 1.63. ([#450](https://github.com/PyO3/rust-numpy/pull/450))
- Add `permute` and `transpose` methods for changing the order of axes of a `PyArray`. ([#428](https://github.com/PyO3/rust-numpy/pull/428))
- Add support for NumPy v2 which had a number of changes to the [C API](https://numpy.org/devdocs/numpy_2_0_migration_guide.html#c-api-changes). ([#442](https://github.com/PyO3/rust-numpy/pull/442))
- Bumped pyo3 dependency to v0.22.0 which required the addition of several new methods to the `Element` trait. ([#435](https://github.com/PyO3/rust-numpy/pull/435))

- v0.21.0
- Migrate to the new `Bound` API introduced by PyO3 0.21. ([#410](https://github.com/PyO3/rust-numpy/pull/410)) ([#411](https://github.com/PyO3/rust-numpy/pull/411)) ([#412](https://github.com/PyO3/rust-numpy/pull/412)) ([#415](https://github.com/PyO3/rust-numpy/pull/415)) ([#416](https://github.com/PyO3/rust-numpy/pull/416)) ([#418](https://github.com/PyO3/rust-numpy/pull/418)) ([#419](https://github.com/PyO3/rust-numpy/pull/419)) ([#420](https://github.com/PyO3/rust-numpy/pull/420)) ([#421](https://github.com/PyO3/rust-numpy/pull/421)) ([#422](https://github.com/PyO3/rust-numpy/pull/422))
Expand Down
7 changes: 5 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,15 @@ num-complex = ">= 0.2, < 0.5"
num-integer = "0.1"
num-traits = "0.2"
ndarray = ">= 0.15, < 0.17"
pyo3 = { version = "0.21.0", default-features = false, features = ["macros"] }
pyo3 = { version = "0.22.0", default-features = false, features = ["macros"] }
rustc-hash = "1.1"

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

[package.metadata.docs.rs]
all-features = true

[features]
gil-refs = ["pyo3/gil-refs"]
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ rust-numpy
===========
[![Actions Status](https://github.com/PyO3/rust-numpy/workflows/CI/badge.svg)](https://github.com/PyO3/rust-numpy/actions)
[![Crate](https://img.shields.io/crates/v/numpy.svg)](https://crates.io/crates/numpy)
[![Minimum rustc 1.48](https://img.shields.io/badge/rustc-1.48+-blue.svg)](https://rust-lang.github.io/rfcs/2495-min-rust-version.html)
[![Minimum rustc 1.63](https://img.shields.io/badge/rustc-1.63+-blue.svg)](https://rust-lang.github.io/rfcs/2495-min-rust-version.html)
[![Documentation](https://docs.rs/numpy/badge.svg)](https://docs.rs/numpy)
[![codecov](https://codecov.io/gh/PyO3/rust-numpy/branch/main/graph/badge.svg)](https://codecov.io/gh/PyO3/rust-numpy)

Expand All @@ -13,7 +13,7 @@ Rust bindings for the NumPy C-API.
- [Current main](https://pyo3.github.io/rust-numpy)

## Requirements
- Rust >= 1.48.0
- Rust >= 1.63.0
- Basically, our MSRV follows the one of [PyO3](https://github.com/PyO3/pyo3)
- Python >= 3.7
- Python 3.6 support was dropped from 0.16
Expand All @@ -38,7 +38,7 @@ name = "rust_ext"
crate-type = ["cdylib"]

[dependencies]
pyo3 = { version = "0.21", features = ["extension-module"] }
pyo3 = { version = "0.22", features = ["extension-module"] }
numpy = "0.21"
```

Expand Down Expand Up @@ -93,7 +93,7 @@ fn rust_ext<'py>(_py: Python<'py>, m: &Bound<'py, PyModule>) -> PyResult<()> {
name = "numpy-test"

[dependencies]
pyo3 = { version = "0.21", features = ["auto-initialize"] }
pyo3 = { version = "0.22", features = ["auto-initialize"] }
numpy = "0.21"
```

Expand Down
2 changes: 1 addition & 1 deletion examples/linalg/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ name = "rust_linalg"
crate-type = ["cdylib"]

[dependencies]
pyo3 = { version = "0.21.0", features = ["extension-module"] }
pyo3 = { version = "0.22.0", features = ["extension-module"] }
numpy = { path = "../.." }
ndarray-linalg = { version = "0.14.1", features = ["openblas-system"] }

Expand Down
2 changes: 1 addition & 1 deletion examples/parallel/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ name = "rust_parallel"
crate-type = ["cdylib"]

[dependencies]
pyo3 = { version = "0.21.0", features = ["extension-module", "multiple-pymethods"] }
pyo3 = { version = "0.22.0", features = ["extension-module", "multiple-pymethods"] }
numpy = { path = "../.." }
ndarray = { version = "0.16", features = ["rayon", "blas"] }
blas-src = { version = "0.8", features = ["openblas"] }
Expand Down
2 changes: 1 addition & 1 deletion examples/simple/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ name = "rust_ext"
crate-type = ["cdylib"]

[dependencies]
pyo3 = { version = "0.21.0", features = ["extension-module", "abi3-py37"] }
pyo3 = { version = "0.22.0", features = ["extension-module", "abi3-py37"] }
numpy = { path = "../.." }

[workspace]
6 changes: 3 additions & 3 deletions examples/simple/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ use pyo3::{
#[pymodule]
fn rust_ext<'py>(m: &Bound<'py, PyModule>) -> PyResult<()> {
// example using generic PyObject
fn head(x: ArrayViewD<'_, PyObject>) -> PyResult<PyObject> {
fn head(py: Python<'_>, x: ArrayViewD<'_, PyObject>) -> PyResult<PyObject> {
x.get(0)
.cloned()
.map(|obj| obj.clone_ref(py))
.ok_or_else(|| PyIndexError::new_err("array index out of range"))
}

Expand Down Expand Up @@ -49,7 +49,7 @@ fn rust_ext<'py>(m: &Bound<'py, PyModule>) -> PyResult<()> {
#[pyfn(m)]
#[pyo3(name = "head")]
fn head_py<'py>(x: PyReadonlyArrayDyn<'py, PyObject>) -> PyResult<PyObject> {
head(x.as_array())
head(x.py(), x.as_array())
}

// wrapper of `axpy`
Expand Down
Loading