Skip to content

Commit

Permalink
Bump to 0.5.0
Browse files Browse the repository at this point in the history
Signed-off-by: Andrej Orsula <[email protected]>
  • Loading branch information
AndrejOrsula committed May 9, 2024
1 parent b8fcb3b commit 77dc889
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 13 deletions.
10 changes: 5 additions & 5 deletions Cargo.lock

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

8 changes: 4 additions & 4 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,12 @@ license = "MIT OR Apache-2.0"
readme = "README.md"
repository = "https://github.com/AndrejOrsula/pyo3_bindgen"
rust-version = "1.74"
version = "0.4.1"
version = "0.5.0"

[workspace.dependencies]
pyo3_bindgen = { path = "pyo3_bindgen", version = "0.4.1" }
pyo3_bindgen_engine = { path = "pyo3_bindgen_engine", version = "0.4.1" }
pyo3_bindgen_macros = { path = "pyo3_bindgen_macros", version = "0.4.1" }
pyo3_bindgen = { path = "pyo3_bindgen", version = "0.5.0" }
pyo3_bindgen_engine = { path = "pyo3_bindgen_engine", version = "0.5.0" }
pyo3_bindgen_macros = { path = "pyo3_bindgen_macros", version = "0.5.0" }

assert_cmd = { version = "2" }
clap = { version = "4.5", features = ["derive"] }
Expand Down
7 changes: 5 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,9 @@ This project is intended to simplify the integration or transition of existing P

On its own, the generated Rust code does not provide any performance benefits over using the Python code. However, it can be used as a starting point for further optimization if you decide to rewrite performance-critical parts of your codebase in pure Rust.

> \[!NOTE\]
> Version `0.5` of `pyo3_bindgen` adapts the new `pyo3::Bound<'py, T>` smart pointer that was introduced in `pyo3` version `0.21`. Use version `0.4` of `pyo3_bindgen` if you require the old "GIL Refs" API.
## Overview

The workspace contains these packages:
Expand All @@ -91,7 +94,7 @@ First, add `pyo3_bindgen` as a **build dependency** to your [`Cargo.toml`](https

```toml
[build-dependencies]
pyo3_bindgen = { version = "0.4" }
pyo3_bindgen = { version = "0.5" }

[dependencies]
pyo3 = { version = "0.21", features = ["auto-initialize"] }
Expand Down Expand Up @@ -141,7 +144,7 @@ As an alternative to build scripts, you can use procedural macros to generate th

```toml
[dependencies]
pyo3_bindgen = { version = "0.4" }
pyo3_bindgen = { version = "0.5" }
```

Subsequently, the `import_python!` macro can be used to generate Rust bindings for the selected Python modules anywhere in your crate. As demonstrated in the example below, Rust bindings are generated for the "math" Python module and can directly be used in the same scope. Similar to the previous approach, the generated bindings must be used within the `pyo3::Python::with_gil` closure to ensure that Python [GIL](https://wiki.python.org/moin/GlobalInterpreterLock) is held.
Expand Down
4 changes: 2 additions & 2 deletions pyo3_bindgen/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
//!
//! ```toml
//! [build-dependencies]
//! pyo3_bindgen = { version = "0.4" }
//! pyo3_bindgen = { version = "0.5" }
//!
//! [dependencies]
//! pyo3 = { version = "0.21", features = ["auto-initialize"] }
Expand Down Expand Up @@ -66,7 +66,7 @@
//!
//! ```toml
//! [dependencies]
//! pyo3_bindgen = { version = "0.4" }
//! pyo3_bindgen = { version = "0.5" }
//! ```
//!
//! Subsequently, the `import_python!` macro can be used to generate Rust bindings for the selected Python modules anywhere in your crate. As demonstrated in the example below, Rust bindings are generated for the "math" Python module and can directly be used in the same scope. Similar to the previous approach, the generated bindings must be used within the `pyo3::Python::with_gil` closure to ensure that Python [GIL](https://wiki.python.org/moin/GlobalInterpreterLock) is held.
Expand Down

0 comments on commit 77dc889

Please sign in to comment.