Skip to content

Commit debf4ae

Browse files
committed
chore: update demo to the latest cookiecutter-robust-python
1 parent 34e13fb commit debf4ae

File tree

5 files changed

+200
-3
lines changed

5 files changed

+200
-3
lines changed

.cookiecutter.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"_commit": "38dcdc32c1ae8d68c230140b81036716e8d3f0b6",
2+
"_commit": "5d756a871ab41b11e3501fbd7b59297c92371b66",
33
"_template": "C:\\Users\\56kyl\\source\\repos\\cookiecutter-robust-python",
44
"add_rust_extension": true,
55
"author": "Kyle Oliver",

.cruft.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"template": "C:\\Users\\56kyl\\source\\repos\\cookiecutter-robust-python",
3-
"commit": "38dcdc32c1ae8d68c230140b81036716e8d3f0b6",
3+
"commit": "5d756a871ab41b11e3501fbd7b59297c92371b66",
44
"checkout": null,
55
"context": {
66
"cookiecutter": {
@@ -20,7 +20,7 @@
2020
"license": "MIT",
2121
"development_status": "Development Status :: 1 - Planning",
2222
"_template": "C:\\Users\\56kyl\\source\\repos\\cookiecutter-robust-python",
23-
"_commit": "38dcdc32c1ae8d68c230140b81036716e8d3f0b6"
23+
"_commit": "5d756a871ab41b11e3501fbd7b59297c92371b66"
2424
}
2525
},
2626
"directory": null

rust/Cargo.lock

Lines changed: 171 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

rust/Cargo.toml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
[package]
2+
name = "robust-maturin-demo"
3+
version = "0.0.0"
4+
edition = "2021"
5+
6+
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
7+
[lib]
8+
name = "robust_maturin_demo"
9+
crate-type = ["cdylib"]
10+
11+
[dependencies]
12+
pyo3 = "0.22.0"

rust/src/lib.rs

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
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 robust_maturin_demo(m: &Bound<'_, PyModule>) -> PyResult<()> {
12+
m.add_function(wrap_pyfunction!(sum_as_string, m)?)?;
13+
Ok(())
14+
}

0 commit comments

Comments
 (0)