Skip to content

ci(docs): unpin the JupyterLite kernel and switch on the browser banner - #954

Merged
petercorke merged 5 commits into
mainfrom
feat/jupyterlite-jspi-check
Nov 18, 2026
Merged

petercorke merged 5 commits into
mainfrom
feat/jupyterlite-jspi-check

Conversation

@petercorke

@petercorke petercorke commented Nov 17, 2026 •

Copy link
Copy Markdown
Owner

What

Unpins the JupyterLite kernel, and tells browsers that cannot run it so. Part of Issue #941; the dependency clean-up in that Issue is a separate PR.

  • docs.yml installed jupyterlite-pyodide-kernel==0.6.1 (Pyodide 0.27.6) because Safari had no WebAssembly JSPI. Safari 27 ships JSPI, and the old Pyodide then hangs there (found in bdsim, docs: let JupyterLite use the current Pyodide kernel, and warn when the browser has no JSPI bdsim#259). It is now a floor, >=0.8.7, which bundles Pyodide 314.0.6 (Python 3.14). There is no wasm ABI to match, because the site installs a pure py3-none-any wheel.

  • A browser without JSPI (Safari before 27, Firefox before 153) gets a banner naming the browsers that work, before the kernel starts. docs/lite/jspi-check.js and inject_jspi_check.py are ported from bdsim, with tests/test_lite_jspi_check.py, and a new docs.yml step runs the injector after the site is built.

  • docs/lite/wasm_check (the Node install check) moves to pyodide 314.0.6 with its lockfile, so it stays equal to the kernel's Pyodide. Its README, the browser_check usage lines and the stale comments in docs.yml are updated.

  • The real-browser check (docs/lite/browser_check) now blocks the deploy: its continue-on-error is removed. It was informational until it had run green on main, and it has. Its failure on this branch's first CI run showed as a green job, and was only found by reading the log. The check itself needed one fix for JupyterLite 0.8: ?path=browser_check.ipynb&reset no longer opens the notebook, so &reset is dropped.

Behaviour

No library code changes. For readers of the hosted notebooks: browsers that have JSPI (Chrome, Edge, Firefox 153 or later, Safari 27 or later) keep working, on a newer Python (3.14). Safari 26 and earlier and Firefox before 153 worked with the old pinned kernel and now see the banner instead, because the new kernel cannot run there.

What I ran, and what I could not

  • docs/lite/wasm_check against Pyodide 314.0.6 with the current pure wheel: PASS (import roboticstoolbox, fkine, analytic IK for Puma560 in 3.5 s and Jaco in 11 s, an inline trajectory plot).
  • tests/test_lite_jspi_check.py: 3 passed. docs.yml parses, and the banner step comes right after the site build.
  • The real-browser check (docs/lite/browser_check), which is continue-on-error and so can fail while the job still shows green: on the first CI run it failed, because with JupyterLite 0.8 the URL ?path=browser_check.ipynb&reset shows the Launcher and never opens the notebook. Without &reset it opens in about 2 seconds (tried four URL forms locally). The last commit drops &reset. With it, the whole check passes locally on kernel 0.8.7 in Chromium: the wheel installs in the browser, the slider and the interactive figure draw, and the animation shows 8 different images.
  • Could not run locally: the exact docs.yml environment; the CI docs-build job here is the test. A draft until it is green. The banner itself was tested by bdsim on Safari 26.
  • python-flint may now be usable on Pyodide 314; a comment in the install check still says it is not usable on 0.27. Not changed here.

AI assistance

Written with Claude Code (Claude Sonnet 5.5), reviewed by the maintainer.

🤖 Generated with Claude Code

petercorke and others added 2 commits November 18, 2026 08:22
Ported from bdsim (PR 259). jspi-check.js shows a banner before the kernel
starts if the browser has no WebAssembly JSPI, and inject_jspi_check.py adds it
to each page of a built JupyterLite site; both are tested.

It is not run by docs.yml yet. RTB's site is still pinned to kernel 0.6.1
(Pyodide 0.27.6), which works without JSPI, so the banner would wrongly warn
Safari 26 and Firefox before 153 today. The CI step that enables it belongs in
the change that unpins the kernel (Issue 941).

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
jupyterlite-pyodide-kernel was pinned to 0.6.1 (Pyodide 0.27.6) because Safari
had no WebAssembly JSPI. Safari 27 ships JSPI, and the old Pyodide then hangs
there (found in bdsim, Issue 941). It is now a floor, >=0.8.7, which bundles
Pyodide 314.0.6 (Python 3.14). RTB installs a pure py3-none-any wheel, so there
is no wasm ABI to match. A browser without JSPI gets the banner added in the
previous commit, run by a new docs.yml step after the site build.

The Node install check moves to pyodide 314.0.6 with its lockfile; with the
current pure wheel it passes (import, fkine, analytic IK, inline animation).

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

Copy link
Copy Markdown

Up to standards ✅

🟢 Issues 0 issues

Results:
0 new issues

View in Codacy

🟢 Metrics 19 complexity · 0 duplication

Metric Results
Complexity 19
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 and others added 2 commits November 18, 2026 09:08
With JupyterLite 0.8 (kernel 0.8.7), lab/index.html?path=...&reset shows the
Launcher and never opens the notebook, so the check timed out waiting for it.
Without '&reset' the notebook opens in about 2 seconds. A fresh browser context
has no saved workspace to reset, so nothing is lost. The whole check now passes
locally on Pyodide 314.0.6 in Chromium.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
It was informational until it had run green on main, and it has: on main with
kernel 0.6.1, and on this branch with 0.8.7. While informational, its failure
on the first run of this branch showed as a green job and was only found by
reading the log.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@petercorke
petercorke marked this pull request as ready for review November 18, 2026 04:00
@petercorke
petercorke merged commit 0339490 into main Nov 18, 2026
27 checks passed
@petercorke
petercorke deleted the feat/jupyterlite-jspi-check branch November 18, 2026 06:41
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