test-crates/workspace-inheritance/python/src/lib.rs
raw| 1 | use pyo3::prelude::*; |
| 2 | |
| 3 | /// Formats the sum of two numbers as string. |
| 4 | #[pyfunction] |
| 5 | fn sum_as_string(a: usize, b: usize) -> PyResult<String> { |
| 6 | Ok((a + b).to_string()) |
| 7 | } |
| 8 | |
| 9 | /// A Python module implemented in Rust. |
| 10 | #[pymodule] |
| 11 | fn workspace_with_path_dep(m: &Bound<'_, PyModule>) -> PyResult<()> { |
| 12 | m.add_function(wrap_pyfunction!(sum_as_string, m)?)?; |
| 13 | Ok(()) |
| 14 | } |