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

Development towards 0.4.0 #17

Merged
merged 23 commits into from
Mar 8, 2024
Merged
Changes from 1 commit
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
331a2ff
Build docs.rs documentation with all features enabled
AndrejOrsula Mar 5, 2024
b3e305d
Make Config fields public
AndrejOrsula Mar 5, 2024
8b763ab
Bump to 0.4.0
AndrejOrsula Mar 5, 2024
7b31e43
Reenable non-proc macro doc tests
AndrejOrsula Mar 6, 2024
4fd885b
Rearrange instructions
AndrejOrsula Mar 6, 2024
1173fce
Fix instructions for `macros` feature
AndrejOrsula Mar 7, 2024
4602f11
Add "py" to forbidden function/type names
AndrejOrsula Mar 7, 2024
8afc84b
Disable some debug asserts due to the uncertainty of Python code
AndrejOrsula Mar 7, 2024
dd11869
Improve error handling in `Codegen::generate()`
AndrejOrsula Mar 7, 2024
bb5b876
Make kwargs optional
AndrejOrsula Mar 7, 2024
b203dc4
Reenable support for generating bindings to builtin functions
AndrejOrsula Mar 8, 2024
d96b64f
Improve docstring processing
AndrejOrsula Mar 8, 2024
d136e77
Make Codegen API more ergonomic
AndrejOrsula Mar 8, 2024
c1b2715
Re-export `pyo3` directly from `pyo3_bindgen`
AndrejOrsula Mar 8, 2024
1e33eb7
Fix loading of libpython symbols in `import_python!` procedural macro
AndrejOrsula Mar 8, 2024
d5af27d
Add "macros" to default features
AndrejOrsula Mar 8, 2024
27c8297
Update documentation
AndrejOrsula Mar 8, 2024
f2f8c9c
Add examples
AndrejOrsula Mar 8, 2024
e718d74
Disable `pygal` example
AndrejOrsula Mar 8, 2024
0203dbe
Slightly simplify README example
AndrejOrsula Mar 8, 2024
593b4c7
Update information about `pyo3_bindgen_macros`
AndrejOrsula Mar 8, 2024
44b0f4a
Update documentation
AndrejOrsula Mar 8, 2024
ec35bd4
Fix TOML formatting
AndrejOrsula Mar 8, 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
Prev Previous commit
Next Next commit
Rearrange instructions
Signed-off-by: Andrej Orsula <orsula.andrej@gmail.com>
AndrejOrsula committed Mar 6, 2024
commit 4fd885bc191acede0f8e3cf53fabf25030f4315a
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -85,7 +85,9 @@ The workspace contains these packages:

## Instructions

Add `pyo3` as a dependency and `pyo3_bindgen` as a build dependency to your [`Cargo.toml`](https://doc.rust-lang.org/cargo/reference/manifest.html) manifest (`auto-initialize` feature of `pyo3` is optional and shown here for your convenience).
### <a href="#-option-1-build-script"><img src="https://rustacean.net/assets/rustacean-flat-noshadow.svg" width="16" height="16"></a> Option 1: Build script

First, add `pyo3` as a dependency and `pyo3_bindgen` as a build dependency to your [`Cargo.toml`](https://doc.rust-lang.org/cargo/reference/manifest.html) manifest (`auto-initialize` feature is optional and shown here for your convenience).

```toml
[dependencies]
@@ -95,9 +97,7 @@ pyo3 = { version = "0.20", features = ["auto-initialize"] }
pyo3_bindgen = { version = "0.4" }
```

### <a href="#-option-1-build-script"><img src="https://rustacean.net/assets/rustacean-flat-noshadow.svg" width="16" height="16"></a> Option 1: Build script

Create a [`build.rs`](https://doc.rust-lang.org/cargo/reference/build-scripts.html) script in the root of your crate that generates bindings to the `py_module` Python module.
Then create a [`build.rs`](https://doc.rust-lang.org/cargo/reference/build-scripts.html) script in the root of your crate that generates bindings to the `py_module` Python module.

```rs
// build.rs
@@ -112,7 +112,7 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
}
```

Afterwards, include the generated bindings anywhere in your crate.
Afterwards, you can include the generated bindings anywhere in your crate.

```rs
include!(concat!(env!("OUT_DIR"), "/bindings.rs"));
10 changes: 5 additions & 5 deletions pyo3_bindgen/src/lib.rs
Original file line number Diff line number Diff line change
@@ -10,7 +10,9 @@
//!
//! ## Instructions
//!
//! Add `pyo3` as a dependency and `pyo3_bindgen` as a build dependency to your [`Cargo.toml`](https://doc.rust-lang.org/cargo/reference/manifest.html) manifest (`auto-initialize` feature of `pyo3` is optional and shown here for your convenience).
//! ### <a href="#-option-1-build-script"><img src="https://rustacean.net/assets/rustacean-flat-noshadow.svg" width="16" height="16"></a> Option 1: Build script
//!
//! First, add `pyo3` as a dependency and `pyo3_bindgen` as a build dependency to your [`Cargo.toml`](https://doc.rust-lang.org/cargo/reference/manifest.html) manifest (`auto-initialize` feature is optional and shown here for your convenience).
//!
//! ```toml
//! [dependencies]
@@ -20,9 +22,7 @@
//! pyo3_bindgen = { version = "0.4" }
//! ```
//!
//! ### <a href="#-option-1-build-script"><img src="https://rustacean.net/assets/rustacean-flat-noshadow.svg" width="16" height="16"></a> Option 1: Build script
//!
//! Create a [`build.rs`](https://doc.rust-lang.org/cargo/reference/build-scripts.html) script in the root of your crate that generates bindings to the `py_module` Python module.
//! Then create a [`build.rs`](https://doc.rust-lang.org/cargo/reference/build-scripts.html) script in the root of your crate that generates bindings to the `py_module` Python module.
//!
//! ```no_run
//! // build.rs
@@ -37,7 +37,7 @@
//! }
//! ```
//!
//! Afterwards, include the generated bindings anywhere in your crate.
//! Afterwards, you can include the generated bindings anywhere in your crate.
//!
//! ```ignore
//! include!(concat!(env!("OUT_DIR"), "/bindings.rs"));