Repository navigation
fix(deps): migrate to pyo3 0.29 to clear three PyO3 advisories - #7
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Team Run ID: ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (2)
Included review availability: 2 reviews are currently available. Your included PR review attempts over the past 7 days set your current allowance at 3 reviews per hour. 📝 SummarySummary by CodeRabbit
WalkthroughThe Python bindings update NumPy and PyO3 to version 0.29. Device parsing replaces deprecated PyO3 ChangesPython compatibility
Priority: ➖ Normal Estimated code review effort: 1 (Trivial) | ~5 minutes Change: Other Merge Risk: ⚪ Minimal · up to The dependency migration and casting updates match the stated compatibility objective, with no identified merge-blocking behavior. 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
Full details: Docstring CoverageExplanation Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 1 functions across 1 files. (1 skipped: 1 unsupported.)
✨ Finishing Touches 💡 1📝 Generate docstrings 💡
🧪 Generate unit tests (beta)
The steam engine shed its old API chain, Comment |
|
Added The red CI on the first push was not this change. Evidence it is unrelated to the pyo3 work:
Pinned Verified inside the exact CI image, |
pyo3 0.21 carries three open advisories: an out-of-bounds read in `nth`/`nth_back` for `PyList` iterators (high), a missing `Sync` bound on `PyCFunction::new_closure` (medium), and a buffer-overflow risk in `PyString::from_object` (low). The first two are fixed in 0.29.0. pyo3 cannot move alone. rust-numpy 0.21 pins `pyo3 ^0.21`, and both pyo3-ffi versions declare `links = "python"`, so cargo refuses a graph containing two. numpy tracks pyo3 version-for-version, so numpy moves to 0.29 with it. The API migration is two call sites: `Bound::downcast` became `Bound::cast` in the 0.29 line. Nothing else in the 98-line binding needed changing. Validation: `cargo check` and `cargo test` pass on Linux. The crate cannot be built on macOS at all -- `Camera` has only a `#[cfg(target_os = "linux")]` variant, so every match on it is non-exhaustive off Linux, which fails identically on pristine main. Verification therefore ran in a rust:1-bookworm container rather than locally, to test the platform this actually ships on. The lockfile resolves pyo3 0.29.2 and numpy 0.29.0, confirmed by reading the lock rather than inferring from the manifest. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
CI cannot go green without this, so it rides with the pyo3 work rather than blocking it. `imageio` pulls `pillow>=8.3.2` unpinned. pillow 12.3.0 ships only manylinux_2_28 wheels -- zero manylinux2014 -- so inside this repo's manylinux2014 CI container pip falls back to building a 47 MB source tarball and fails. 12.2.0 still ships 16 such wheels. Only the 3.10 and 3.11 matrix entries were affected: 12.3.0 requires Python >=3.10, so the 3.8 and 3.9 jobs already resolved an older pillow. This is time-based rot, not fallout from the pyo3 change: the failure happens during `pip install -r dev-requirements.txt`, before any Rust compiles, and this repository's CI last ran in June. Nothing in the Rust dependency graph can affect a Python wheel build. Pinning pillow rather than moving the container to manylinux_2_28: the container choice governs the compatibility of the wheels this package publishes, and narrowing that to serve a test dependency would be the wrong trade. Validation: run inside the exact CI image, quay.io/pypa/manylinux2014_x86_64:2026.05.01-2 on cp310, pip now resolves pillow 12.2.0 from pillow-12.2.0-cp310-cp310-manylinux2014_x86_64.manylinux_2_17_x86_64.whl rather than the sdist. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
…014 wheels" The pin existed only to keep pillow installable inside the manylinux2014 container. The x86_64 matrix now runs manylinux_2_28, where pillow 12.3.0 resolves from a manylinux_2_28 wheel unaided, so the pin no longer does anything except cap a dependency for a reason that has gone away. Leaving it would be worse than removing it: a future reader would find a pin whose stated justification no longer matches the CI it refers to. Validation: inside quay.io/pypa/manylinux_2_28_x86_64:2026.05.01-2, a pip resolve of dev-requirements.txt yields zero sdists on cp312 and cp313 without any pillow constraint, with pillow 12.3.0 coming from a manylinux_2_28 wheel. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
118da5f to
b732b12
Compare
Closes all 6 open Dependabot alerts on this repo — three advisories, each reported against both
Cargo.lockandcrates/pyvirtualcam-py/Cargo.toml.nth/nth_backforPyListiteratorsSyncbound onPyCFunction::new_closurePyString::from_objectpyo3 can't move alone
rust-numpy 0.21pinspyo3 ^0.21, and bothpyo3-ffiversions declarelinks = "python"— cargo refuses any graph containing two packages linking the same native library. numpy tracks pyo3 version-for-version, so it moves to 0.29 alongside.The migration is two lines
Bound::downcastbecameBound::castin the 0.29 line:Nothing else in the 98-line binding needed changing — a smaller jump than 0.21 → 0.29 suggests.
Validation ran on Linux, deliberately
This crate cannot be built on macOS at all.
Camerahas only a#[cfg(target_os = "linux")]variant, so everymatchon it is non-exhaustive off Linux — 5 errors, which reproduce identically on pristinemain. A local check would have been meaningless.So
cargo checkandcargo testwere run in arust:1-bookwormcontainer, on the platform this actually ships to. Both pass.Resolved versions read back from the lockfile rather than inferred from the manifest: pyo3 0.29.2, numpy 0.29.0.
Tracked in LuxTronic/luxtronic-infrastructure#1150.
🤖 Generated with Claude Code