diff --git a/.github/workflows/run_python_unit_tests.yml b/.github/workflows/run_python_unit_tests.yml index 87e2809..e9afc40 100644 --- a/.github/workflows/run_python_unit_tests.yml +++ b/.github/workflows/run_python_unit_tests.yml @@ -13,7 +13,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - python-version: [ "3.9", "3.10", "3.11", "3.12" ] + python-version: [ "3.9", "3.10", "3.11", "3.12", "3.13" ] steps: - uses: actions/checkout@v3 diff --git a/bindings/python/Cargo.toml b/bindings/python/Cargo.toml index 68ddb97..1166fef 100644 --- a/bindings/python/Cargo.toml +++ b/bindings/python/Cargo.toml @@ -8,8 +8,8 @@ name = "codelists_rs" crate-type = ["cdylib"] [dependencies] -pyo3 = { version = "0.20.3", features = ["extension-module"] } +pyo3 = { version = "0.25", features = ["extension-module"] } chrono = { version = "0.4.39", features = ["serde"] } codelist-rs = { path = "../../rust/codelist-rs" } codelist-validator-rs = { path = "../../rust/codelist-validator-rs" } -indexmap = "2.9.0" \ No newline at end of file +indexmap = "2.9.0" diff --git a/bindings/python/src/codelist.rs b/bindings/python/src/codelist.rs old mode 100644 new mode 100755 index b6dae16..b99441b --- a/bindings/python/src/codelist.rs +++ b/bindings/python/src/codelist.rs @@ -91,7 +91,7 @@ impl PyCodeList { } /// Add an entry to the codelist - #[pyo3(text_signature = "($self, code, term=None, comment=None)")] + #[pyo3(signature = (code, term=None, comment=None))] fn add_entry( &mut self, code: String, @@ -370,6 +370,7 @@ impl PyCodeList { } /// Add Validation Information to the codelist + #[pyo3(signature = (reviewer, status=None, notes=None))] fn add_validation_info( &mut self, reviewer: String, diff --git a/bindings/python/src/lib.rs b/bindings/python/src/lib.rs index 31e6c10..6275eb7 100644 --- a/bindings/python/src/lib.rs +++ b/bindings/python/src/lib.rs @@ -11,11 +11,11 @@ use factory::PyCodeListFactory; /// Top-level Python module `codelists_rs` #[pymodule] -fn codelists_rs(py: Python, m: &PyModule) -> PyResult<()> { +fn codelists_rs(py: Python, m: &Bound<'_, PyModule>) -> PyResult<()> { // Add codelist submodule let codelist_module = PyModule::new(py, "codelist")?; codelist_module.add_class::()?; - m.add_submodule(codelist_module)?; + m.add_submodule(&codelist_module)?; // Register it globally under the full dotted path py.import("sys")?.getattr("modules")?.set_item("codelists_rs.codelist", codelist_module)?; @@ -23,7 +23,7 @@ fn codelists_rs(py: Python, m: &PyModule) -> PyResult<()> { // Add factory submodule let factory_module = PyModule::new(py, "factory")?; factory_module.add_class::()?; - m.add_submodule(factory_module)?; + m.add_submodule(&factory_module)?; // Register it globally under the full dotted path py.import("sys")?.getattr("modules")?.set_item("codelists_rs.factory", factory_module)?;