Skip to content

Commit

Permalink
Upgrade pyo3 to 0.23.1 (#2308)
Browse files Browse the repository at this point in the history
* Upgrade pyo3 to 0.23.1

* Remove pypy3.9 cross compile test
  • Loading branch information
messense authored Nov 17, 2024
1 parent 39ec7bf commit badd16f
Show file tree
Hide file tree
Showing 44 changed files with 196 additions and 200 deletions.
4 changes: 0 additions & 4 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -369,10 +369,6 @@ jobs:
python: python3.10
container: ghcr.io/rust-cross/manylinux2014-cross:s390x
# PyPy
- target: aarch64-unknown-linux-gnu
abi: pp39-pypy39_pp73
python: pypy3.9
container: ghcr.io/rust-cross/manylinux2014-cross:aarch64
- target: aarch64-unknown-linux-gnu
abi: pp310-pypy310_pp73
python: pypy3.10
Expand Down
4 changes: 2 additions & 2 deletions guide/src/bindings.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ maturin automatically detects pyo3 bindings when it's added as a dependency in `
pyo3 bindings has `Py_LIMITED_API`/abi3 support, enable the `abi3` feature of the `pyo3` crate to use it:

```toml
pyo3 = { version = "0.18", features = ["abi3"] }
pyo3 = { version = "0.23", features = ["abi3"] }
```

You may additionally specify a minimum Python version by using the `abi3-pyXX`
Expand Down Expand Up @@ -97,7 +97,7 @@ fn print_cli_args(py: Python) -> PyResult<()> {
// `["/home/ferris/.venv/bin/print_cli_args", "a", "b", "c"])`
println!(
"{:?}",
py.import_bound("sys")?
py.import("sys")?
.getattr("argv")?
.extract::<Vec<String>>()?
);
Expand Down
12 changes: 6 additions & 6 deletions guide/src/tutorial.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ crate-type = ["cdylib"]
rand = "0.8.4"

[dependencies.pyo3]
version = "0.21.1"
version = "0.23.1"
# "abi3-py38" tells pyo3 (and maturin) to build using the stable ABI with minimum Python version 3.8
features = ["abi3-py38"]
```
Expand Down Expand Up @@ -205,7 +205,7 @@ You can also compile a performance-optimized program by adding the `-r` or `--re
(.venv) ferris@rustbox [~/src/rust/guessing-game] % maturin develop
🔗 Found pyo3 bindings with abi3 support for Python ≥ 3.8
🐍 Not using a specific python interpreter (With abi3, an interpreter is only required on windows)
Compiling pyo3-build-config v0.18.0
Compiling pyo3-build-config v0.23.1
Compiling libc v0.2.119
Compiling once_cell v1.10.0
Compiling cfg-if v1.0.0
Expand All @@ -226,10 +226,10 @@ You can also compile a performance-optimized program by adding the `-r` or `--re
Compiling rand_chacha v0.3.1
Compiling rand v0.8.5
Compiling quote v1.0.15
Compiling pyo3-ffi v0.18.0
Compiling pyo3 v0.18.0
Compiling pyo3-macros-backend v0.18.0
Compiling pyo3-macros v0.18.0
Compiling pyo3-ffi v0.23.1
Compiling pyo3 v0.23.1
Compiling pyo3-macros-backend v0.23.1
Compiling pyo3-macros v0.23.1
Compiling guessing-game v0.1.0 (/Users/ferris/src/rust/guessing-game)
Finished dev [unoptimized + debuginfo] target(s) in 13.31s
```
Expand Down
2 changes: 1 addition & 1 deletion src/templates/Cargo.toml.j2
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ crate-type = ["cdylib"]

[dependencies]
{% if bindings == "pyo3" -%}
pyo3 = "0.22.0"
pyo3 = "0.23.1"
{% elif bindings == "uniffi" -%}
uniffi = "0.28.0"

Expand Down
2 changes: 1 addition & 1 deletion test-crates/lib_with_disallowed_lib/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@ crate-type = ["cdylib"]

[dependencies]
libz-sys = { version = "1.1.2", default-features = false }
pyo3 = { version = "0.22.4", features = ["extension-module"] }
pyo3 = { version = "0.23.1", features = ["extension-module"] }
2 changes: 1 addition & 1 deletion test-crates/lib_with_path_dep/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,5 @@ crate-type = ["cdylib"]

[dependencies]
# Don't use the macros feature, which makes compilation much faster
pyo3 = { version = "0.22.0", default-features = false, features = ["extension-module"] }
pyo3 = { version = "0.23.1", default-features = false, features = ["extension-module"] }
some_path_dep = { path = "../some_path_dep" }
20 changes: 10 additions & 10 deletions test-crates/pyo3-abi3-without-version/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion test-crates/pyo3-abi3-without-version/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ authors = ["konstin <[email protected]>"]
edition = "2021"

[dependencies]
pyo3 = { version = "0.22.4", features = ["abi3", "extension-module"] }
pyo3 = { version = "0.23.1", features = ["abi3", "extension-module"] }

[lib]
name = "pyo3_abi3_without_version"
Expand Down
20 changes: 10 additions & 10 deletions test-crates/pyo3-bin/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion test-crates/pyo3-bin/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ edition = "2021"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
pyo3 = { version = "0.22.4", features = ["auto-initialize"] }
pyo3 = { version = "0.23.1", features = ["auto-initialize"] }
2 changes: 1 addition & 1 deletion test-crates/pyo3-bin/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ use pyo3::prelude::*;

fn main() -> PyResult<()> {
Python::with_gil(|py| {
let builtins = py.import_bound("builtins")?;
let builtins = py.import("builtins")?;
let total: i32 = builtins.getattr("sum")?.call1((vec![1, 2, 3],))?.extract()?;
assert_eq!(total, 6);
println!("Hello, world!");
Expand Down
20 changes: 10 additions & 10 deletions test-crates/pyo3-feature/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion test-crates/pyo3-feature/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ version = "0.7.3"
edition = "2021"

[dependencies]
pyo3 = { version = "0.22.4", optional = true }
pyo3 = { version = "0.23.1", optional = true }
20 changes: 10 additions & 10 deletions test-crates/pyo3-mixed-implicit/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion test-crates/pyo3-mixed-implicit/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ readme = "README.md"
edition = "2021"

[dependencies]
pyo3 = { version = "0.22.4", features = ["extension-module"] }
pyo3 = { version = "0.23.1", features = ["extension-module"] }

[lib]
name = "pyo3_mixed_implicit"
Expand Down
Loading

0 comments on commit badd16f

Please sign in to comment.