Skip to content

Commit

Permalink
feature: Update pyo3 version to 0.18.3
Browse files Browse the repository at this point in the history
  - template-dependent extensions conflicting with this pyo3 version need to either fix their dependency using a manifest-comment "//: ..." or migrate their code to the new pyo3 version.
  • Loading branch information
mityax committed Apr 24, 2023
1 parent 2b43056 commit eb2a863
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion examples/test_workspace/crate_c/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -25,5 +25,5 @@ name = "crate_c"
crate-type = ["cdylib"]

[dependencies]
pyo3 = { version = "0.16.5", features = ["extension-module"] }
pyo3 = { version = "0.18.3", features = ["extension-module"] }
crate_b = { path = "../crate_b" }
2 changes: 1 addition & 1 deletion rustimport/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
crate-type = ["cdylib"]
[dependencies]
pyo3 = { version = "0.16.2", features = ["extension-module"] }
pyo3 = { version = "0.18.3", features = ["extension-module"] }
"""


Expand Down
4 changes: 2 additions & 2 deletions rustimport/pre_processing/pyo3_template.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ def __generate_manifest(self) -> bytes:
'crate-type': ['cdylib'],
},
'dependencies': {
'pyo3': {'version': '0.16.2', 'features': ['extension-module']}
'pyo3': {'version': '0.18.3', 'features': ['extension-module']}
}
})

Expand All @@ -37,7 +37,7 @@ def __process_content(self) -> bytes:
def __generate_pymodule(self) -> bytes:
# A rather rudimentary implementation of generating PyO3 the "pymodule" macro's contents
functions = re.finditer(
rb'#\[pyfunction.*\s*(?:\w+\s+)*?(?:#\[pyo3.*)?\s*(?:\w+\s+)*?fn\s+([\w0-9]+)', self.contents, re.MULTILINE
rb'#\[pyfunction.*\s*(?:\w+\s+)*?(?:#\[pyo3.*)?\s*(?:\w+\s+)*?fn\s+([\w0-9]+)', self.contents, re.MULTILINE
)
structs = re.finditer(rb'#\[pyclass]\s*(?:\w+\s+)*?(?:struct|enum)\s+([\w0-9]+)', self.contents, re.MULTILINE)

Expand Down

0 comments on commit eb2a863

Please sign in to comment.