Skip to content

Commit

Permalink
stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
codekansas committed Oct 28, 2024
1 parent dc12d03 commit 424a3b9
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 1 deletion.
6 changes: 6 additions & 0 deletions .cargo/config.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
[target.aarch64-apple-darwin]

rustflags = [
"-C", "link-arg=-undefined",
"-C", "link-arg=dynamic_lookup",
]
2 changes: 2 additions & 0 deletions kscaleos/bindings/src/bin/stub_gen.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
use pyo3_stub_gen::Result;

fn main() -> Result<()> {
println!("Generating stub info...");
let stub = bindings::stub_info()?;
println!("Generating stubs...");
stub.generate()?;
Ok(())
}
10 changes: 9 additions & 1 deletion kscaleos/bindings/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,10 +1,18 @@
use kscaleos::hello_world as kscaleos_hello_world;
use pyo3::prelude::*;
use pyo3::{wrap_pyfunction, PyResult};
use pyo3_stub_gen::define_stub_info_gatherer;

#[pyfunction]
pub fn hello_world() {
pub fn hello_world() -> PyResult<()> {
kscaleos_hello_world();
Ok(())
}

#[pymodule]
fn bindings(m: &Bound<PyModule>) -> PyResult<()> {
m.add_wrapped(wrap_pyfunction!(hello_world))?;
Ok(())
}

define_stub_info_gatherer!(stub_info);

0 comments on commit 424a3b9

Please sign in to comment.