Skip to content

Bound malachite-bigint to one minor (0.14) - #23

Open
sarayev wants to merge 1 commit into
RustPython:mainfrom
sarayev:bound-malachite
Open

sarayev wants to merge 1 commit into
RustPython:mainfrom
sarayev:bound-malachite

Conversation

@sarayev

@sarayev sarayev commented Nov 15, 2026 •

Copy link
Copy Markdown

Replaces malachite-bigint = "0" with "0.14", the minor RustPython main uses.

With "0", a fresh build of a published RustPython release resolves pymath's malachite-bigint to the newest 0.x while RustPython stays on its own minor, and the two BigInt types don't unify (see #22). With one malachite minor per pymath minor, a published release always resolves to a single malachite-bigint, and cargo publish catches a mismatch before release.

Narrowing the bound is a breaking change for anyone on another malachite minor, so this needs a new minor when released. I've left the version for you to set.

Testing:

  • cargo test --features malachite-bigint passes (188/188) against Python 3.14.
  • RustPython main with this branch via [patch.crates-io]: cargo check -p rustpython-vm -p rustpython-stdlib compiles with only malachite-bigint 0.14.0 in the lock.

@coderabbitai

coderabbitai Bot commented Nov 15, 2026 •

Copy link
Copy Markdown

Explain Change →

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 53 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 54a5c9e1-c083-476e-b29c-2510400704d5
Commits

Reviewing files that changed from the base of the PR and between b97ef18 and c7e3c87.

Files selected for processing: 1

  • Cargo.toml

No actionable comments were generated in the recent review.

Walkthrough

The manifest updates the pymath crate version from 0.2.0 to 0.3.0. It also constrains the optional malachite-bigint dependency to version 0.14 and adds comments about keeping the bound aligned with RustPython’s requirement.

Changes: Package metadata

Layer / File(s) Summary
Manifest version and dependency updates
Cargo.toml
The crate version changes to 0.3.0. The optional malachite-bigint requirement changes from "0" to "0.14", with comments linking the bound to RustPython’s requirement.

Estimated code review effort: 1 (Trivial) | ~5 minutes

Change: Other

Suggested reviewers: youknowone

Merge Risk: Minimal · previous review b97ef

This release bump narrows the optional malachite-bigint dependency to 0.14 so pymath and RustPython can resolve the same BigInt type. No defect is established in this repository. Keep the bound aligned with RustPython's requirement when publishing.

Pre-merge checks: Passed 4

Check name Status Explanation
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.
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title "Bound malachite-bigint to one minor (0.14)" matches the main change. The PR narrows the optional malachite-bigint dependency constraint from "0" to "0.14" in Cargo.toml, and also bumps pyma…
Full details: Title check

Explanation

The title "Bound malachite-bigint to one minor (0.14)" matches the main change. The PR narrows the optional malachite-bigint dependency constraint from "0" to "0.14" in Cargo.toml, and also bumps pymath to 0.3.0. The title names the primary change and is specific. The version bump is not mentioned, which is acceptable because the title need not cover every detail.

Finishing Touches

Generate unit tests (beta)

  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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

Recent review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: df187516-7b54-47ee-a9f2-6213a82f70fd
Commits

Reviewing files that changed from the base of the PR and between 6992bbf and b97ef18.

Files selected for processing: 1

  • Cargo.toml

Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.

@sarayev sarayev changed the title Bound malachite-bigint to 0.14 and release as 0.3.0 Bound malachite-bigint to one minor (0.14) Nov 15, 2026
With "0", a fresh build resolves malachite-bigint to the newest 0.x while the RustPython release depending on this crate stays on its own minor, and the two BigInt types do not unify. Bound it to the minor RustPython main uses.
@youknowone

Copy link
Copy Markdown
Member

Thanks, malachite upgrades the version frequently, which usually doesn't affect pymath. I am looking for better way to release this.
Are you using rustpython as library or binary? if you install it as binary, cargo install rustpython --locked will work. If you install it as library, editing malachite dependency aligned to rustpython will work for 0.6.0.
I know this is not a real fix. let me check a bit more if your patch is the only way to fix this or not. sorry for inconvenience!

@sarayev

sarayev commented Nov 20, 2026

Copy link
Copy Markdown
Author

Thanks for looking into it @youknowone , and no worries!

We use it as a library: rustpython-vm and rustpython-stdlib are dependencies of a crate that our users pull in as a git dependency. So --locked doesn't help, because Cargo resolves fresh for each downstream project and ignores our lockfile. We've worked around it on our side by committing a lockfile with malachite pinned to 0.12. But anyone else who depends on rustpython 0.6 as a library hits the same error until they add the pin themselves.

The reason I went for a narrower bound: with "0", this will come back every time malachite ships a new minor before RustPython moves to it, since Cargo always picks the newest version that matches. A RustPython patch release that moves to malachite 0.14 would fix 0.6 for now, but it would break again at 0.15. One malachite minor per pymath minor keeps a published release resolving to a single BigInt.

Happy to go with whatever release approach you prefer. If another approach works better for you, I can update the PR.

@sarayev

sarayev commented Nov 26, 2026 •

Copy link
Copy Markdown
Author

Hi @youknowone , did you have a chance to check this actually? Thanks!

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