Repository navigation
Fix dependency installation in island payloads - #10832
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
All contributors have signed the CLA ✍️ ✅ |
|
@mscolnick I have started the AI code review. It will take a few minutes to complete. |
There was a problem hiding this comment.
🟡 Changes recommended
Moderate issues remain with payload ordering, Pyodide version marker evaluation, and Markdown/QMD dependency extraction.
Get a fresh assessment by requesting another Copilot review.
Pull request overview
Carries explicit PEP 723 dependencies through island payloads so Pyodide can install them before execution.
Changes:
- Adds dependency metadata to island payloads.
- Restores dependencies in frontend-generated notebooks.
- Adds regression tests, snapshots, and documentation.
File summaries
| File | Summary |
|---|---|
tests/_pyodide/test_pyodide_session.py |
Tests dependency discovery. |
tests/_islands/test_island_generator.py |
Tests payload generation. |
tests/_islands/snapshots/notebook-dependencies.txt |
Captures notebook dependency metadata. |
tests/_islands/snapshots/body-dependencies.txt |
Captures dependency payload HTML. |
marimo/_schemas/islands.py |
Defines the optional dependency field. |
marimo/_islands/_island_generator.py |
Extracts and serializes dependencies. |
frontend/src/core/islands/parse.ts |
Parses and restores dependency metadata. |
frontend/src/core/islands/__tests__/parse.test.ts |
Tests frontend dependency handling. |
docs/guides/exporting/webassembly_html.md |
Documents dependency payload usage. |
Review details
Suppressed comments (2)
frontend/src/core/islands/parse.ts:245
- When multiple accepted payloads share an app ID,
reactivePayloadAppIdsis computed across all of them, but the app is only created inside the per-cell loop after the static-only guard. Thus a static-only payload with dependencies followed by a reactive payload for the same app drops those dependencies here, and the generated notebook can still miss required packages. Merge dependencies for reactive app IDs before skipping static-only cells, and cover this ordering.
if (app && payload.dependencies?.length) {
app.dependencies = [
...new Set([...(app.dependencies ?? []), ...payload.dependencies]),
];
marimo/_islands/_island_generator.py:755
filter_requirements_for_emscriptenevaluatespython_versionagainst the exporter’s interpreter because it only overridessys_platform. Pyodide is pinned to Python 3.14 (marimo/_pyodide/pyodide_constraints.py:23-27) while marimo supports older hosts, so exporting on Python 3.13 drops a valid requirement such aspkg; python_version >= '3.14'before it reaches the browser; the runtime cannot recover it. Preserve the raw requirements here and letfind_packagesfilter them in Pyodide, or evaluate markers against the pinned Pyodide version.
return filter_requirements_for_emscripten(reader.dependencies)
- Files reviewed: 9/9 changed files
- Comments generated: 1
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| reader = PyProjectReader.from_script(notebook.header.value) | ||
| return filter_requirements_for_emscripten(reader.dependencies) |
There was a problem hiding this comment.
All reported issues were addressed across 9 files
Reply with feedback, questions, or to request a fix.
Re-trigger cubic
Coverage Report for ./frontend
File Coverage
|
||||||||||||||||||||||||||||||||||||||
…stall (#140) Widen the marimo bound to <0.26 after re-running the pin-bump checklist against 0.25.1 (tests, strict docs rebuild, WASM islands, anywidgets, and the workbench in a browser). marimo 0.25 carries PEP 723 dependencies in the islands payload (marimo-team/marimo#10832) but strips version specifiers before installing (marimo-team/marimo#10870), so drop that field from our bootstrap payload and keep the pinned bootstrap as the sole installer.
Fixes #10806 by carrying explicit PEP 723 dependencies through island JSON payloads and restoring them before Pyodide startup. Documents include_payload=True and adds regression coverage across Python export, frontend parsing, and dependency discovery.