Opt into FromPyObject derive for Clone pyclasses under PyO3 0.29#90
Merged
Merged
Conversation
The pyo3 0.29 bump (frequenz-floss#89) updated the dependency but didn't address 0.29's deprecation of the *automatic* `FromPyObject` derive for `#[pyclass]` types that implement `Clone`, which `cargo clippy -D warnings` rejects. `ComponentGraphConfig` and `FormulaOverrides` are both extracted from Python by value (`config.extract::<ComponentGraphConfig>()` and the by-value `Option<FormulaOverrides>` argument), so opt back in explicitly with `#[pyclass(from_py_object)]` to preserve the previous behavior. The 0.29 bump itself also pulled in the fix for the out-of-bounds read in list/tuple iterator `nth`/`nth_back` (GHSA-36hh-v3qg-5jq4); note it under Upgrading. Signed-off-by: Sahas Subramanian <sahas.subramanian@proton.me>
46d1d9b to
0b61315
Compare
0b61315 to
126e80f
Compare
llucax
approved these changes
Jun 22, 2026
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
PyO3 0.29 (bumped in #89) deprecated the automatic
FromPyObjectderive for#[pyclass]types that implementClone, whichcargo clippy -D warningsnow rejects.
Changes
ComponentGraphConfigandFormulaOverrideswith
#[pyclass(..., from_py_object)]— both are extracted from Python byvalue, so the derive must remain. No behavior change.
out-of-bounds read fix) under Upgrading in the release notes.