Update to Pyodide v314.0.0#9844
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
All contributors have signed the CLA ✍️ ✅ |
|
Looks like the CLA check did not recognise the text in the PR description. Leaving it in a new comment below: |
|
I have read the CLA Document and I hereby sign the CLA |
|
recheck |
|
I haven't run the full test suite locally yet, but I ran the Pyodide acceptance check and various tests for the WASM rules, and they passed. Note that I had to manually add Pyodide 314.0.0 to the cooldown ignore list in the pnpm configuration, as there is no way to install it otherwise 😅 Could the CI be triggered on this PR? Thank you! |
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
Updates the project’s Pyodide/wasm compatibility configuration and linting to reflect new “wasm-incompatible” imports, and adds a regression test for the new rule behavior.
Changes:
- Bump the Pyodide version references and update derived Python version metadata.
- Extend the wasm incompatible-imports lint rule to flag
pydecimal(andtest) and add a related lint test fixture. - Extend the runtime
install()API with new keyword-only parameters (constraints,reinstall).
Reviewed changes
Copilot reviewed 7 out of 8 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/_lint/test_wasm_rules.py | Adds a test asserting pydecimal is flagged by the wasm incompatible-imports rule. |
| tests/_lint/test_files/wasm_incompatible.py | Extends the wasm-incompatible fixture to import pydecimal. |
| pnpm-workspace.yaml | Adds a workspace release-age exclude entry for the updated Pyodide version. |
| marimo/_runtime/patches.py | Extends install() signature with new keyword-only params. |
| marimo/_pyodide/pyodide_constraints.py | Updates Pyodide version and derived Python version metadata. |
| marimo/_lint/rules/wasm/incompatible_imports.py | Flags additional imports (pydecimal, test) as wasm-incompatible. |
| frontend/package.json | Bumps the pyodide dependency version. |
Files not reviewed (1)
- pnpm-lock.yaml: Language not supported
| // `Could not extract indexURL path from pyodide module` | ||
| // This fixes for Firefox and does not break Chrome/others | ||
| indexURL: `https://cdn.jsdelivr.net/pyodide/${opts.pyodideVersion}/full/`, | ||
| convertNullToNone: true, |
There was a problem hiding this comment.
Since Pyodide 0.28, we convert JS null to pyodide.ffi.JsNull instead of None. So if I understand correctly, js.user_config.to_py() and js.query_params.to_py() below can carry null (like a nullable display.locale), and JsNull is neither None nor msgspec-encodable.
Note: I am aware that we have this option as deprecated upstream though, so I think we need make null --> None happen before passing it along and I'm not sure about this a bit, need to read some more marimo code 😄
There was a problem hiding this comment.
this sounds ok, thanks for flagging
|
So I dug into a few things and I started comparing https://wasm.marimo.app/pyodide-lock.json against our 314.0.0 lockfile on jsDelivr at https://cdn.jsdelivr.net/pyodide/v314.0.0/full/pyodide-lock.json. I think the results are worth sharing: https://wasm.marimo.app/pyodide-lock.json has 357 packages. Most of them (334) are just relative filenames and basically a snapshot of Pyodide's standard package set at the time. The other 23 are absolute URLs, which is where I see they are patched-in things Pyodide either didn't have at the time or had at the wrong version. I went through all 23 of those custom entries and checked them against the bundled set we have in 314.0.0:
As for whether marimo needs a custom lockfile at all going forward, TBH I think yes, but only because of That said, a bigger idea—to offer some food for thought—is that if instead of relying on the lockfile to resolve |
|
@agriyakhetarpal, our lockfile just extends the pyodide one at runtime (on the fly). we only declare about 4 custom packages (~a total of 34 including transitive) that get put in the lockfile. visiting https://wasm.marimo.app/pyodide-lock.json right now will just give you we need this regardless because this helps with waterfalls and slow load times, otherwise we need to reach out to pypi for dependency resolution. |
Bundle ReportChanges will increase total bundle size by 11.28kB (0.04%) ⬆️. This is within the configured threshold ✅ Detailed changes
Affected Assets, Files, and Routes:view changes for bundle: marimo-esmAssets Changed:
|
|
I've removed some unnecessary packages and cleaned up our lockfile for 3.14 a bit more: https://wasm.marimo.app/pyodide-lock.json?pyodide=v314.0.0 |
|
thank you for making this change! this is a big release, congrats! |
|
Amazing, thanks for the review @mscolnick and for the lockfile updates! |
📝 Summary
This PR updates Pyodide to v314.0.0, which we released yesterday: https://blog.pyodide.org/posts/314-release/
This is my first contribution to marimo, and I ought to have asked about it first, based on the contributing guide, but I remember that I was already involved in a conversation about Pyodide-related updates and that there were discussions about missing packages. I cannot seem to find that issue in the list of open issues now :/, so I hope y'all don't mind me chiming in directly with a PR! Thank you!
Also, it looks like y'all have your own Pyodide lockfile at https://wasm.marimo.app/pyodide-lock.json. Since many of the disabled packages in later Pyodide versions are available, I think this infrastructure needs to be updated at marimo's end and can now rely on https://cdn.jsdelivr.net/pyodide/v314.0.0/full/pyodide-lock.json. Please let me know in case any packages are not available.
I have read the CLA Document and I hereby sign the CLA
📋 Pre-Review Checklist
✅ Merge Checklist