Skip to content

ci: update pyo3 to 0.28#176

Merged
jpopesculian merged 1 commit intomainfrom
ci-update-pyo3
Feb 26, 2026
Merged

ci: update pyo3 to 0.28#176
jpopesculian merged 1 commit intomainfrom
ci-update-pyo3

Conversation

@jpopesculian
Copy link
Contributor

@jpopesculian jpopesculian commented Feb 11, 2026

Summary by CodeRabbit

  • Chores
    • Bumped Python interop dependency to v0.28 and normalized manifest formatting.
    • Migrated Python runtime access/initialization to an attach-based model for more reliable Python integration.
    • Updated async/generator, serialization, and interop surfaces to use updated Python ownership/stream types, improving async Python compatibility and stability without changing user-facing behavior.

@coderabbitai
Copy link

coderabbitai bot commented Feb 11, 2026

📝 Walkthrough

Walkthrough

This pull request upgrades PyO3 to 0.28, replaces PyObject with Py<PyAny> across public APIs and streams, moves Python GIL usage from Python::with_gil to Python::attach, and switches PyO3 initialization to Python::initialize().

Changes

Cohort / File(s) Summary
Manifests / Dependencies
Cargo.toml, runner/Cargo.toml
Bumped pyo3 and pyo3-async-runtimes 0.24 → 0.28; normalized dependency formatting and preserved feature sets.
Core interop & pipeline
runner/src/pipeline.rs, runner/src/ipython.rs
Replaced PyObject with Py<PyAny> in structs, method signatures, stream item types, and getters; adjusted many public APIs accordingly.
Python runtime & async/generator glue
runner/src/python.rs
Migrated async generators, iterator streams, serde_pickle bindings, and related helpers to Py<PyAny> ownership and Python::attach usage; updated trait bounds to FromPyObjectOwned.
CLI, commands & tests
src/commands/*, src/commands/test.rs, src/commands/info.rs, src/commands/version.rs
Replaced with_gilattach; updated pipeline/test signatures and introduced PipelineResult = Result<Option<Py<PyAny>>, EvaluationError>.
Evaluation & runtime flow
src/evaluate.rs, src/main.rs, src/ipynb.rs
Evaluation inputs/streams use Py<PyAny>; GIL acquisition switched to attach; PyO3 init changed to Python::initialize().
Printing / output helpers
src/print.rs
Changed progress-suspend func ownership to Py<PyAny>; updated __call__/__getattr__ return types; added __setattr__ and __delattr__; migrated GIL usage to attach.
Python client & module glue
src/python_module.rs
Replaced with_gilattach in client send/s3_get paths; response casting tightened and error propagation adjusted.
Small formatting-only edits
Cargo.toml entries, misc runner manifests
Whitespace/formatting normalizations in Cargo manifests without semantic changes.

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

Poem

🐇 I swapped my PyObjects for Py today,
I attach to Python, no with_gil in my way.
Versions hopped to 0.28, neat and spry,
Streams and generators now leap high.
Carrot cheers for tidy types — hop, hop, hi!

🚥 Pre-merge checks | ✅ 2 | ❌ 1
❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 23.81% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The PR title accurately summarizes the primary change: updating the pyo3 dependency to version 0.28 across multiple Cargo.toml files and related code changes.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch ci-update-pyo3

No actionable comments were generated in the recent review. 🎉

🧹 Recent nitpick comments
runner/src/pipeline.rs (1)

382-387: Redundant .clone_ref(py) on PyNone.

PyNone::get(py).unbind() already produces an owned Py<PyNone>. The subsequent .clone_ref(py) creates a second owned handle (extra refcount bump), after which the first is dropped. You can simplify to:

♻️ Suggested simplification
         let (original_input, mut context) = Python::attach(|py| {
             (
                 input.clone_ref(py),
-                PyNone::get(py).unbind().clone_ref(py).into_any(),
+                PyNone::get(py).unbind().into_any(),
             )
         });

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@jpopesculian jpopesculian added this pull request to the merge queue Feb 26, 2026
Merged via the queue into main with commit 85e3754 Feb 26, 2026
17 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants