-
Notifications
You must be signed in to change notification settings - Fork 3
Update PyO3 to 0.25 #82
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
4df5db7
migrate pyo3 from 0.20 to 0.21
oylenshpeegul d13aeab
migrate pyo3 from 0.21 to 0.22
oylenshpeegul 886e1e1
migrate from pyo3 0.22 to 0.23
oylenshpeegul 8c5f30d
migrate pyo3 from 0.23 to 0.25
oylenshpeegul 8ae2271
Hm. is rustfmt from my editor not the same as cargo fmt?
oylenshpeegul e6ef8e2
test Python 3.13 too!
oylenshpeegul 0a552a8
whitepace, really?
oylenshpeegul cf6b6d5
no, comma...grr
oylenshpeegul d62c884
wot?
oylenshpeegul 5630fab
testing if this works!
CarolineMorton File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -11,19 +11,19 @@ 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<()> { | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Nice one ! |
||
| // Add codelist submodule | ||
| let codelist_module = PyModule::new(py, "codelist")?; | ||
| codelist_module.add_class::<PyCodeList>()?; | ||
| m.add_submodule(codelist_module)?; | ||
| m.add_submodule(&codelist_module)?; | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Brilliant - so now we do borrows! |
||
|
|
||
| // Register it globally under the full dotted path | ||
| py.import("sys")?.getattr("modules")?.set_item("codelists_rs.codelist", codelist_module)?; | ||
|
|
||
| // Add factory submodule | ||
| let factory_module = PyModule::new(py, "factory")?; | ||
| factory_module.add_class::<PyCodeListFactory>()?; | ||
| 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)?; | ||
|
|
||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i'm doubting myself now. I put these in the first place but i can see i only did it for a couple of the methods but not others. And they still seem to work. which makes me think that maybe we don't them at all. What do you think? Is the signature for overwriting the argument names maybe?
Great job anyway. Nice to see that their macro is actually getting simplier (signature vs text_signature)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am happy to add this in, but I don't seem to be able to. I don't understand what's going on.
For the signature stuff, I think we do need it now. I'm not sure about text_signature.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And, yeah, I think we should test for 3.13 and I think it should work (it works on my machine...famous last words). If we're lucky, it will work with 3.14 (when it comes out) with no changes.