Skip to content

Fix dependency installation in island payloads - #10832

Merged
mscolnick merged 2 commits into
mainfrom
ms/fix/issue-10806
Sep 14, 2026
Merged

mscolnick merged 2 commits into
mainfrom
ms/fix/issue-10806

Conversation

@mscolnick

@mscolnick mscolnick commented Sep 14, 2026 •

Copy link
Copy Markdown
Contributor

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.

Copilot AI lite review requested due to automatic review settings September 14, 2026 14:49
@mscolnick
mscolnick requested a review from akshayka as a code owner September 14, 2026 14:49
@vercel

vercel Bot commented Sep 14, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
marimo-docs Ready Ready Preview Sep 14, 2026 3:04pm UTC

Request Review

@github-actions github-actions Bot added the documentation Improvements or additions to documentation label Sep 14, 2026
@github-actions

Copy link
Copy Markdown
Contributor

All contributors have signed the CLA ✍️ ✅
Posted by the CLA Assistant Lite bot.

@mscolnick

Copy link
Copy Markdown
Contributor Author

@cubic-dev-ai

@cubic-dev-ai

cubic-dev-ai Bot commented Sep 14, 2026

Copy link
Copy Markdown
Contributor

@cubic-dev-ai

@mscolnick I have started the AI code review. It will take a few minutes to complete.

peter-gy
peter-gy previously approved these changes Sep 14, 2026

Copilot AI left a comment

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.

🟡 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, reactivePayloadAppIds is 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_emscripten evaluates python_version against the exporter’s interpreter because it only overrides sys_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 as pkg; python_version >= '3.14' before it reaches the browser; the runtime cannot recover it. Preserve the raw requirements here and let find_packages filter 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.

Comment thread marimo/_islands/_island_generator.py Outdated
Comment on lines +754 to +755
reader = PyProjectReader.from_script(notebook.header.value)
return filter_requirements_for_emscripten(reader.dependencies)

@cubic-dev-ai cubic-dev-ai Bot left a comment •

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.

All reported issues were addressed across 9 files

Reply with feedback, questions, or to request a fix.

Re-trigger cubic

Comment thread marimo/_islands/_island_generator.py Outdated
Comment thread marimo/_islands/_island_generator.py Outdated
@github-actions

github-actions Bot commented Sep 14, 2026 •

Copy link
Copy Markdown
Contributor

Coverage Report for ./frontend

Status Category Percentage Covered / Total
🔵 Lines 57.67% 21948 / 38053
🔵 Statements 57.61% 22334 / 38765
🔵 Functions 50.91% 4964 / 9750
🔵 Branches 51.12% 11435 / 22365
File Coverage
File Stmts Branches Functions Lines Uncovered Lines
Changed Files
frontend/src/core/islands/parse.ts 96.57% 95.16% 100% 96.55% 134-135, 503, 512, 522, 539
Generated in workflow #21396 for commit 97637c9 by the Vitest Coverage Report Action

@mscolnick
mscolnick enabled auto-merge (squash) September 14, 2026 15:26
@mscolnick
mscolnick disabled auto-merge September 14, 2026 15:27
@mscolnick
mscolnick merged commit 1495aa7 into main Sep 14, 2026
43 checks passed
@mscolnick
mscolnick deleted the ms/fix/issue-10806 branch September 14, 2026 15:27
ljchang added a commit to ljchang/marimo-book that referenced this pull request Oct 2, 2026
…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.

This branch was successfully deployed

1 active deployment
Preview — 97637c91 Deployed Sep 14, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation

Projects

None yet

3 participants