diff --git a/actuator/rust/py.pyi b/actuator/rust/py.pyi new file mode 120000 index 0000000..46d6eb6 --- /dev/null +++ b/actuator/rust/py.pyi @@ -0,0 +1 @@ +py/py.pyi \ No newline at end of file diff --git a/actuator/rust/py/Cargo.toml b/actuator/rust/py/Cargo.toml index d9ab01c..d36cb5f 100644 --- a/actuator/rust/py/Cargo.toml +++ b/actuator/rust/py/Cargo.toml @@ -24,4 +24,3 @@ serialport = "4.5.1" [[bin]] name = "stub_gen" -doc = false diff --git a/actuator/rust/py/py.pyi b/actuator/rust/py/py.pyi new file mode 100644 index 0000000..c0084f5 --- /dev/null +++ b/actuator/rust/py/py.pyi @@ -0,0 +1,7 @@ +# This file is automatically generated by pyo3_stub_gen +# ruff: noqa: E501, F401 + + +def hello_world() -> None: + ... + diff --git a/actuator/rust/pyproject.toml b/actuator/rust/py/pyproject.toml similarity index 93% rename from actuator/rust/pyproject.toml rename to actuator/rust/py/pyproject.toml index f080922..30f55f7 100644 --- a/actuator/rust/pyproject.toml +++ b/actuator/rust/py/pyproject.toml @@ -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"] diff --git a/actuator/rust/py/src/bin/stub_gen.rs b/actuator/rust/py/src/bin/stub_gen.rs index a01eef0..74bbe80 100644 --- a/actuator/rust/py/src/bin/stub_gen.rs +++ b/actuator/rust/py/src/bin/stub_gen.rs @@ -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(()) } diff --git a/actuator/rust/py/src/lib.rs b/actuator/rust/py/src/lib.rs index f1f5a65..e255999 100644 --- a/actuator/rust/py/src/lib.rs +++ b/actuator/rust/py/src/lib.rs @@ -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!");