-
Notifications
You must be signed in to change notification settings - Fork 11
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
Update to Pyo3 v0.22 #7
Conversation
Thanks! Potentially rebase on main please, and then CI should run :) |
780b502
to
fd70e99
Compare
I'll wait for this one to be merged before I do anything else, so we're not stepping on each other 😄 |
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 think this looks good to me, thanks! Just one small correction (I'll apply it) and then let's merge.
|
||
if let Err(e) = R::spawn_local(async move { | ||
let result = R::scope_local( | ||
locals2.clone(), | ||
Python::with_gil(|py| locals2.clone_ref(py)), |
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 think these patterns are all correct for now. It would be interesting to explore further what we can do to reduce calls to Python::with_gil
, and the correct way to release the GIL across yield points too.
I think they are follow up areas of research, which probably can yield new APIs both here and upstream in PyO3.
(I guess there's potentially a lot of interesting performance benchmarking to do?)
This is my first attempt at updating to pyo3 v0.22 without the
py-clone
feature. I've added aPython::with_gil
naively everywhere a GIL token was required, so it may need some refactoring & cleanup next. Furthermore all fmt/cargo checks should be resolved.ref #1