Skip to content

Commit 126e80f

Browse files
committed
Opt into FromPyObject derive for Clone pyclasses under PyO3 0.29
The pyo3 0.29 bump (#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>
1 parent 6d6f002 commit 126e80f

2 files changed

Lines changed: 3 additions & 3 deletions

File tree

RELEASE_NOTES.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
## Upgrading
88

9-
<!-- Here goes notes on how to upgrade from previous versions, including deprecations and what they should be replaced with -->
9+
- Bumped PyO3 to 0.29 to pull in the fix for RUSTSEC out-of-bounds read advisory GHSA-36hh-v3qg-5jq4 (`nth`/`nth_back` on list/tuple iterators).
1010

1111
## New Features
1212

src/graph.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ use pyo3::{
1616
types::{PyAny, PySet, PyType},
1717
};
1818

19-
#[pyclass(subclass)]
19+
#[pyclass(subclass, from_py_object)]
2020
#[derive(Clone, Default, Debug)]
2121
pub struct ComponentGraphConfig {
2222
config: cg::ComponentGraphConfig,
@@ -60,7 +60,7 @@ impl ComponentGraphConfig {
6060
}
6161
}
6262

63-
#[pyclass(subclass)]
63+
#[pyclass(subclass, from_py_object)]
6464
#[derive(Clone, Default, Debug)]
6565
pub struct FormulaOverrides {
6666
overrides: cg::FormulaOverrides,

0 commit comments

Comments
 (0)