Skip to content

feat(ci): add a real-Pyodide dependency-completeness check for JupyterLite - #69

Merged
petercorke merged 1 commit into
mainfrom
feat/jupyterlite-wasm-ci-test
Aug 12, 2026
Merged

petercorke merged 1 commit into
mainfrom
feat/jupyterlite-wasm-ci-test

Conversation

@petercorke

Copy link
Copy Markdown
Owner

Summary

  • Adds docs/lite/wasm_check/: a real-Pyodide, real-WASM CI check (Node.js + the pyodide npm package, not a mock) that _mvtb_nb_bootstrap.py's Pyodide install path actually works — installs every seed package for real, then confirms import machinevisiontoolbox succeeds.
  • This is exactly the check that would have caught the original tqdm bug that shipped in 2.2.0 (a new dependency added to pyproject.toml but never added to the Pyodide seed-install list).
  • Deliberately scoped to dependency-completeness only, not URL-resolution correctness — Node has no equivalent of a browser's Web Worker base URL, and that question was already answered by testing the real built site in a real browser (see docs/notebooks/README.md). This check sidesteps the HTTP/URL layer entirely via Pyodide's emfs: virtual-filesystem install scheme.
  • Reuses the real, unmodified ensure_installed() rather than re-listing seed packages a third time (avoiding exactly the kind of drift this check exists to catch).
  • Wired into docs.yml right after the wheel build, using actions/setup-node with npm caching.
  • Written with an eye toward being copied to RTB/bdsim/etc. for their own JupyterLite setups — see the README for the reasoning and the porting notes.

Test plan

  • Ran locally against the real current wheel — passes, prints Running in browser using MVTB v2.2.0 with OpenCV 4.11.0 / PASS: Pyodide install check succeeded.
  • Ran against a deliberately-broken case (tqdm removed from the seed list, reproducing the original 2.2.0 bug) — fails with a clear diagnostic explaining the likely cause and the fix, not just a raw traceback
  • Confirmed the diagnostic-failure path exits non-zero (CI-actionable)
  • package-lock.json committed, pinned to the same Pyodide version (314.0.3) confirmed working in real-browser testing earlier

🤖 Generated with Claude Code

…rLite

Runs the actual Pyodide/WASM runtime under Node.js (the pyodide npm
package) against the real, unmodified ensure_installed() from
_mvtb_nb_bootstrap.py, so the exact class of bug that shipped in 2.2.0
(a new pyproject.toml dependency added but never added to the Pyodide
seed-install list) now fails CI instead of shipping silently.

Deliberately scoped to dependency completeness only -- not to whether
the real notebook's relative-URL wheel-install path resolves correctly
inside a real browser's Pyodide Web Worker, which Node has no equivalent
of and can't faithfully test. That question was already answered by
testing the real built site in a real browser (see docs/notebooks/
README.md); this check sidesteps it entirely by installing the wheel via
Pyodide's own emfs: virtual-filesystem scheme instead of over HTTP.

Verified against a deliberately-broken case (tqdm removed from the seed
list, reproducing the original 2.2.0 bug) -- fails with a clear
diagnostic pointing at the fix, not just a raw traceback.

Intended as a template other toolboxes (RTB, bdsim, ...) can copy for
their own JupyterLite setups -- see docs/lite/wasm_check/README.md.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@codacy-production

Copy link
Copy Markdown

Not up to standards ⛔

🔴 Issues 2 critical · 3 high

Alerts:
⚠ 5 issues (≤ 0 issues of at least minor severity)

Results:
5 new issues

Category Results
Security 2 critical
3 high

View in Codacy

🟢 Metrics 0 complexity · 0 duplication

Metric Results
Complexity 0
Duplication 0

View in Codacy

NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.

@petercorke
petercorke merged commit e13abb2 into main Aug 12, 2026
18 of 19 checks passed
@petercorke
petercorke deleted the feat/jupyterlite-wasm-ci-test branch October 3, 2026 14:47
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.

1 participant