Skip to content

Commit 119a30b

Browse files
authored
Merge pull request #281 from sanders41/pyo3
Update for pyo3 new bound api
2 parents b3f615b + 23a6852 commit 119a30b

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/rust_files.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ fn build_latest_dependencies(min_python_version: &str, download_latest_packages:
1212
let abi = format!("abi3-py{}", min_python_version.replace('.', ""));
1313
let mut packages = vec![RustPackageVersion {
1414
name: "pyo3".to_string(),
15-
version: "0.20.3".to_string(),
15+
version: "0.21.0".to_string(),
1616
features: Some(vec!["extension-module".to_string(), abi]),
1717
}];
1818

@@ -111,7 +111,7 @@ fn sum_as_string(a: usize, b: usize) -> PyResult<String> {{
111111
}}
112112
113113
#[pymodule]
114-
fn _{module}(_py: Python, m: &PyModule) -> PyResult<()> {{
114+
fn _{module}(_py: Python, m: &Bound<'_, PyModule>) -> PyResult<()> {{
115115
m.add_function(wrap_pyfunction!(sum_as_string, m)?)?;
116116
Ok(())
117117
}}
@@ -189,7 +189,7 @@ name = "_{}"
189189
crate-type = ["cdylib"]
190190
191191
[dependencies]
192-
pyo3 = {{ version = "0.20.3", features = ["extension-module", "abi3-py38"] }}
192+
pyo3 = {{ version = "0.21.0", features = ["extension-module", "abi3-py38"] }}
193193
"#,
194194
&project_info.project_slug, &project_info.project_description, &project_info.source_dir
195195
);
@@ -218,7 +218,7 @@ fn sum_as_string(a: usize, b: usize) -> PyResult<String> {{
218218
}}
219219
220220
#[pymodule]
221-
fn _{}(_py: Python, m: &PyModule) -> PyResult<()> {{
221+
fn _{}(_py: Python, m: &Bound<'_, PyModule>) -> PyResult<()> {{
222222
m.add_function(wrap_pyfunction!(sum_as_string, m)?)?;
223223
Ok(())
224224
}}

0 commit comments

Comments
 (0)