Skip to content

Commit

Permalink
update python bindings generation
Browse files Browse the repository at this point in the history
  • Loading branch information
codekansas committed Oct 8, 2024
1 parent 1e31614 commit 6f86f58
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 4 deletions.
1 change: 1 addition & 0 deletions actuator/rust/py.pyi
1 change: 0 additions & 1 deletion actuator/rust/py/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,3 @@ serialport = "4.5.1"

[[bin]]
name = "stub_gen"
doc = false
7 changes: 7 additions & 0 deletions actuator/rust/py/py.pyi
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# This file is automatically generated by pyo3_stub_gen
# ruff: noqa: E501, F401


def hello_world() -> None:
...

Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@ requires = ["maturin>=1.1,<2.0"]
build-backend = "maturin"

[project]
name = "lib"
name = "py"
requires-python = ">=3.9"


[project.optional-dependencies]
test = ["pytest", "pyright", "ruff"]
2 changes: 1 addition & 1 deletion actuator/rust/py/src/bin/stub_gen.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use pyo3_stub_gen::Result;

fn main() -> Result<()> {
let stub = lib::stub_info()?;
let stub = py::stub_info()?;
stub.generate()?;
Ok(())
}
3 changes: 2 additions & 1 deletion actuator/rust/py/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
use pyo3::prelude::*;
use pyo3_stub_gen::define_stub_info_gatherer;
use pyo3_stub_gen::{define_stub_info_gatherer, derive::gen_stub_pyfunction};

#[gen_stub_pyfunction]
#[pyfunction]
fn hello_world() -> PyResult<()> {
println!("Hello, world!");
Expand Down

0 comments on commit 6f86f58

Please sign in to comment.