Dependencies cleanup by ShaharNaveh · Pull Request #6151 · RustPython/RustPython
Walkthrough
Workspace-wide dependency version bumps and additions, several crate Cargo.toml dependency removals/relocations, and benchmark updates replacing pyo3::Python::with_gil with pyo3::Python::attach and using std::hint::black_box; no public API changes.
Changes
| Cohort / File(s) | Summary of Changes |
|---|---|
Workspace dependenciesCargo.toml |
Bumped many dependency versions (e.g., serde, chrono, indexmap, bitflags, ahash, unicode-*, etc.); added malachite-base = "0.6"; updated dev-dependency pyo3 to "0.26" (features: ["auto-initialize"]). |
Benchmarks GIL and black_boxbenches/execution.rs, benches/microbenchmarks.rs |
Replaced pyo3::Python::with_gil with pyo3::Python::attach; switched black_box import to std::hint::black_box; benchmark logic otherwise unchanged. |
Common crate deps cleanupcommon/Cargo.toml |
Removed workspace dependencies: bstr, memchr. |
Compiler dev-deps cleanupcompiler/Cargo.toml |
Removed dev-dependency rand. |
Compiler core deps/lints tweakcompiler/core/Cargo.toml |
Removed serde dependency entry; adjusted placement of workspace = true relative to [lints]; EOF newline added. |
Derive crate deps tweakderive/Cargo.toml |
Removed proc-macro2 = { workspace = true }; EOF newline added. |
Stdlib Windows target depsstdlib/Cargo.toml |
Removed junction from Windows target dependencies; other Windows workspace deps unchanged. |
VM crate deps refactorvm/Cargo.toml |
Moved nix into [target.'cfg(unix)'.dependencies]; bumped optional flamer to "0.5"; removed memoffset, unicode_names2; removed Windows schannel. |
Sequence Diagram(s)
sequenceDiagram
autonumber
participant Bench as Benchmark
participant PyO3 as pyo3
participant GIL as GIL
participant VM as Python_VM
Note over Bench,PyO3: New flow uses Python::attach for GIL scope
Bench->>PyO3: Python::attach(|py| { ... })
activate PyO3
PyO3->>GIL: attach current thread (GIL acquired)
activate GIL
GIL->>VM: compile & execute Python code
VM-->>GIL: result / error
deactivate GIL
PyO3-->>Bench: closure returns with result
deactivate PyO3
Note over Bench: Measurements use std::hint::black_box for isolation
Estimated code review effort
🎯 3 (Moderate) | ⏱️ ~20 minutes
Possibly related PRs
- Update some deps #6053 — Overlapping workspace dependency version bumps (e.g.,
bitflags,indexmap). - Switch to newer thread::LocalKey convenience methods #6123 — Related changes touching thread/GIL handling patterns and bench adjustments.
Suggested reviewers
- youknowone
Poem
A nibble of deps, a hop through the bench,
I attach to the GIL with a whisker’s clench.
Black boxes hush what numbers reveal—
Versions align, the wheels all wheel.
Tap-tap my paw: cargo says “go!” 🐇✨
Pre-merge checks and finishing touches
✅ Passed checks (3 passed)
| Check name | Status | Explanation |
|---|---|---|
| Description Check | ✅ Passed | Check skipped - CodeRabbit’s high-level summary is enabled. |
| Title Check | ✅ Passed | The title "Dependencies cleanup" accurately describes the main intent of this changeset, which is focused on dependency version bumps, removals, and minor workspace adjustments (see multiple Cargo.toml edits and added malachite-base). It is short, single-line, and directly related to the diff rather than including unrelated details. Reviewers scanning PR history will understand this is a dependency-maintenance change. |
| Docstring Coverage | ✅ Passed | No functions found in the changes. Docstring coverage check skipped. |
✨ Finishing touches
🧪 Generate unit tests
- Create PR with unit tests
- Post copyable unit tests in a comment
📜 Recent review details
Configuration used: Path: .coderabbit.yml
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (1)
Cargo.lockis excluded by!**/*.lock
📒 Files selected for processing (1)
Cargo.toml(3 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
- Cargo.toml
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (10)
- GitHub Check: Check Rust code with rustfmt and clippy
- GitHub Check: Check the WASM package and demo
- GitHub Check: Run snippets and cpython tests on wasm-wasi
- GitHub Check: Run snippets and cpython tests (windows-2025)
- GitHub Check: Run snippets and cpython tests (ubuntu-latest)
- GitHub Check: Run snippets and cpython tests (macos-latest)
- GitHub Check: Run rust tests (macos-latest)
- GitHub Check: Run rust tests (ubuntu-latest)
- GitHub Check: Run rust tests (windows-2025)
- GitHub Check: Ensure compilation on various targets
Tip
👮 Agentic pre-merge checks are now available in preview!
Pro plan users can now enable pre-merge checks in their settings to enforce checklists before merging PRs.
- Built-in checks – Quickly apply ready-made checks to enforce title conventions, require pull request descriptions that follow templates, validate linked issues for compliance, and more.
- Custom agentic checks – Define your own rules using CodeRabbit’s advanced agentic capabilities to enforce organization-specific policies and workflows. For example, you can instruct CodeRabbit’s agent to verify that API documentation is updated whenever API schema files are modified in a PR. Note: Upto 5 custom checks are currently allowed during the preview period. Pricing for this feature will be announced in a few weeks.
Please see the documentation for more information.
Example:
reviews: pre_merge_checks: custom_checks: - name: "Undocumented Breaking Changes" mode: "warning" instructions: | Pass/fail criteria: All breaking changes to public APIs, CLI flags, environment variables, configuration keys, database schemas, or HTTP/GraphQL endpoints must be documented in the "Breaking Change" section of the PR description and in CHANGELOG.md. Exclude purely internal or private changes (e.g., code not exported from package entry points or explicitly marked as internal).
Please share your feedback with us on this Discord post.
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.
Comment @coderabbitai help to get the list of available commands and usage tips.