You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Migrate to IntoPyObject trait from ToPyObject and IntoPy traits, reenable deprecation warnings in the affected files.
Rename Pants functions with _bound in the name to no longer have _bound in the name. (The functions were renamed as part of the PyO3 v0.22.x migration, but can now be renamed back to the original names, just like PyO3 did in v0.23.x.)
The text was updated successfully, but these errors were encountered:
…21670)
As part of [upgrading to PyO3
v0.23.x](#21671), access
to`pyclass`-annotated types will no longer be implicitly synchronized
against the Python GIL. Those `pyclass`-annotated types [must now be
`Sync`](https://pyo3.rs/v0.23.1/class/thread-safety) and provide that
synchronization explicitly.
Several places in Pants use `RefCell` which is not Send/Sync by itself.
This PR uses `pyo3::sync::GILProtected` to provide explicit
synchronization against the GIL for those use cases. (Eventually, we may
wish to not use `GILProtected` to enable use of the Python 3.13 "no GIL"
free threaded build, but that day is not today.)
[Migration
guide](https://pyo3.rs/v0.23.1/migration.html#free-threaded-python-support)
[Upgrade to v0.23.x of the `pyo3`
crate](#21671):
- Functions in PyO3 with `_bound` suffixes existed in PyO3 only for
easing migration to the `Bound` API. They are deprecated now and new
methods without the `_bound` suffixes have been re-introduced in PyO3.
This PR renames call sites accordingly and updates code to also reflect
that some of the new APIs (e.g., `PyTuple::new`) are now fallible.
- The `IntoPy` and `ToPyObject` traits are deprecated in favor of the
new `IntoPyObject` trait (which is fallible). To ease migration, this PR
only disables deprecation warnings as errors in the affected files.
(Unfortunately, `IntoPyObject` was not introduced in the current v0.22.x
version and so we cannot migrate ahead of the upgrade (unlike what was
done in #21670 for the new
`pyclass` Sync requirement).) Migration will take place in follow-on
PRs.
- This PR does add an implementation of `IntoPyObject` for `&Value` to
support some existing call sites.
Upgrade to the latest PyO3 v0.23.x release from v.0.22.x.
Migration steps:
pyclass
-annotated types to use explicit GIL synchronization viaGILProtected
since implicit GIL sync goes away in v.0.23.x. useGILProtected
to synchronize access to variouspyclass
types #21670ToPyObject
andIntoPy
traits). PyO3: upgrade to v0.23.x #21657IntoPyObject
trait fromToPyObject
andIntoPy
traits, reenable deprecation warnings in the affected files._bound
in the name to no longer have_bound
in the name. (The functions were renamed as part of the PyO3 v0.22.x migration, but can now be renamed back to the original names, just like PyO3 did in v0.23.x.)The text was updated successfully, but these errors were encountered: