Skip to content

Move dependency to workspace for example rustpython-without-js#7796

Open
fanninpm wants to merge 1 commit intoRustPython:mainfrom
fanninpm:move-deps-to-workspace-for-ex-rustpython-without-js
Open

Move dependency to workspace for example rustpython-without-js#7796
fanninpm wants to merge 1 commit intoRustPython:mainfrom
fanninpm:move-deps-to-workspace-for-ex-rustpython-without-js

Conversation

@fanninpm
Copy link
Copy Markdown
Contributor

@fanninpm fanninpm commented May 7, 2026

cc @ShaharNaveh

Summary by CodeRabbit

  • Chores
    • Updated internal dependency management configuration to use workspace-managed versioning for consistency.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 7, 2026

📝 Walkthrough

Walkthrough

The getrandom dependency in the WebAssembly example project's Cargo.toml is updated to use the workspace-managed version instead of a hardcoded crates.io version, aligning with centralized dependency management.

Changes

Workspace Dependency Alignment

Layer / File(s) Summary
Dependency Configuration
example_projects/wasm32_without_js/rustpython-without-js/Cargo.toml
getrandom dependency switched from fixed version "0.3" to workspace-managed { workspace = true }.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~2 minutes

Possibly related PRs

Suggested reviewers

  • ShaharNaveh
  • youknowone

Poem

🐰 A workspace so neat,
Dependencies beat,
One version to keep,
No secrets to seep—
Harmony, clean and sweet!

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main change: moving a dependency (getrandom) to workspace management for the rustpython-without-js example project.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

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

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🧹 Nitpick comments (1)
example_projects/wasm32_without_js/rustpython-without-js/Cargo.toml (1)

15-16: 💤 Low value

Consider removing the empty [patch.crates-io] section.

The empty [patch.crates-io] section serves no purpose and adds unnecessary clutter. Consider removing it to keep the configuration clean.

♻️ Proposed cleanup
-[patch.crates-io]
-
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@example_projects/wasm32_without_js/rustpython-without-js/Cargo.toml` around
lines 15 - 16, Remove the empty Cargo.toml section headed by [patch.crates-io]
since it provides no configuration; delete that entire empty section (the lone
"[patch.crates-io]" header and any blank lines immediately under it) so the
manifest is cleaner and contains only meaningful entries.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@example_projects/wasm32_without_js/rustpython-without-js/Cargo.toml`:
- Line 13: The Cargo.toml currently declares a workspace root via the
[workspace] table while also using workspace = true for membership; remove the
conflicting workspace root declaration by deleting the [workspace] section (the
literal "[workspace]" table) so this Cargo.toml becomes a workspace member
consistent with the existing workspace = true usage.
- Line 10: This Cargo.toml is conflicting because the dependency declaration
getrandom = { workspace = true } makes the crate a workspace member while the
file also contains an empty [workspace] header and an empty [patch.crates-io]
header; remove the stray [workspace] section and the empty [patch.crates-io]
section so the manifest remains a workspace member (keep getrandom = { workspace
= true } intact).

---

Nitpick comments:
In `@example_projects/wasm32_without_js/rustpython-without-js/Cargo.toml`:
- Around line 15-16: Remove the empty Cargo.toml section headed by
[patch.crates-io] since it provides no configuration; delete that entire empty
section (the lone "[patch.crates-io]" header and any blank lines immediately
under it) so the manifest is cleaner and contains only meaningful entries.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yml

Review profile: CHILL

Plan: Pro

Run ID: b493fd19-d98f-4887-84e6-b5ad97cc00e3

📥 Commits

Reviewing files that changed from the base of the PR and between e10a27b and 0607f3d.

📒 Files selected for processing (1)
  • example_projects/wasm32_without_js/rustpython-without-js/Cargo.toml


[dependencies]
getrandom = "0.3"
getrandom = { workspace = true }
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🔴 Critical

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Description: Verify that the workspace root defines getrandom dependency

# Find the workspace root Cargo.toml (should be at repository root)
if [ -f "Cargo.toml" ]; then
  echo "=== Checking root Cargo.toml for workspace.dependencies.getrandom ==="
  rg -A 2 '^\[workspace\.dependencies\]' Cargo.toml
  echo ""
  echo "=== Searching for getrandom in workspace dependencies ==="
  rg -P 'getrandom\s*=' Cargo.toml
else
  echo "ERROR: Root Cargo.toml not found"
  exit 1
fi

Repository: RustPython/RustPython

Length of output: 413


🏁 Script executed:

cat -n example_projects/wasm32_without_js/rustpython-without-js/Cargo.toml

Repository: RustPython/RustPython

Length of output: 457


Remove the [workspace] section on line 13.

The file uses workspace = true on line 10 (making it a workspace member), but the presence of [workspace] on line 13 creates a conflicting configuration. A Cargo.toml cannot simultaneously be a workspace root and a workspace member. Remove the empty [workspace] section.

Additionally, remove the empty [patch.crates-io] section on line 15 as it serves no purpose.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@example_projects/wasm32_without_js/rustpython-without-js/Cargo.toml` at line
10, This Cargo.toml is conflicting because the dependency declaration getrandom
= { workspace = true } makes the crate a workspace member while the file also
contains an empty [workspace] header and an empty [patch.crates-io] header;
remove the stray [workspace] section and the empty [patch.crates-io] section so
the manifest remains a workspace member (keep getrandom = { workspace = true }
intact).

getrandom = { workspace = true }
rustpython-vm = { path = "../../../crates/vm", default-features = false, features = ["compiler"] }

[workspace]
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🔴 Critical | ⚡ Quick win

Remove the [workspace] section — it conflicts with workspace membership.

A Cargo.toml cannot be both a workspace root (which declares [workspace]) and a workspace member (which uses workspace = true for dependencies). This configuration is invalid and will cause Cargo to fail.

Since line 10 uses workspace = true, this file should be a workspace member, not a workspace root. Remove the [workspace] section.

🔧 Proposed fix
-[workspace]
-
 [patch.crates-io]
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
[workspace]
[patch.crates-io]
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@example_projects/wasm32_without_js/rustpython-without-js/Cargo.toml` at line
13, The Cargo.toml currently declares a workspace root via the [workspace] table
while also using workspace = true for membership; remove the conflicting
workspace root declaration by deleting the [workspace] section (the literal
"[workspace]" table) so this Cargo.toml becomes a workspace member consistent
with the existing workspace = true usage.

@youknowone
Copy link
Copy Markdown
Member

Because this is example, not sure this is good idea

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