Skip to content

fix(lite): the notebooks install the wheel built with the site, and a browser check proves it - #863

Merged
petercorke merged 2 commits into
mainfrom
fix/lite-install-bundled-wheel
Oct 22, 2026
Merged

petercorke merged 2 commits into
mainfrom
fix/lite-install-bundled-wheel

Conversation

@petercorke

Copy link
Copy Markdown
Owner

The JupyterLite site has been installing the last release of the toolbox from PyPI, not the wheel built with it, since #848. This fixes that, and adds the checks that would have caught it. No change to the toolbox.

The bug

The bootstrap cell (#848, copied from MVTB's) preferred "the wheel bundled with this site" using Path("/pypi").glob(...). There is no /pypi folder in a JupyterLite kernel (checked in Chromium with the pinned kernel 0.6.1), so that branch never ran and it always did micropip.install("roboticstoolbox-python") from PyPI. "Try it Now" therefore did not track main, and fixes such as #860 were not in the site. The old piplite.install(...) cells did pick up the bundled wheel, because piplite looks in the site's own index first, so #848 regressed this. MVTB has the same code: petercorke/machinevision-toolbox-python#160.

Nothing noticed, because the Node check mounted the wheel in Pyodide's filesystem and redirected the pypi/ install to it.

The fix

In the browser, install through piplite (the site's index first), falling back to micropip when there is no piplite, for example under Node. The generated bootstrap cell is regenerated in all 13 notebooks; nothing else in them changes.

The checks

  1. Node/Pyodide check (docs/lite/wasm_check/): a stand-in piplite installs the wheel (replacing the pypi/ redirect), and a new step plots a trajectory under the ipympl backend in real Pyodide and checks that the inline mode is chosen and a different image is pushed for every step. It fails with the code from before fix(plot): a trajectory is animated whatever %matplotlib says #860 (AssertionError: notebook-widget).
  2. Real-browser check (docs/lite/browser_check/, new, Playwright and Chromium): builds a small site with the wheel and one notebook, runs it, and requires the bootstrap line; the hash of the installed PyPlot.py to equal the checkout's (so the wheel built here is the one installed); an ipywidgets slider; an ipympl figure of one pose; and at least 5 different images while an animation cell runs. It is a docs.yml step after the site is built, informational (continue-on-error) until it has passed once on main, with the screenshot kept as an artifact on failure. Run locally it passes in about 2 minutes, and fails with the old bootstrap (the toolbox in the browser is not the wheel built from this checkout ... installed the last release from PyPI).

This also confirms in a real JupyterLite site that ipywidgets and ipympl work there, and that a trajectory animates with the fix.

Please note

Merging this changes the generated bootstrap cell, and only that cell, in every notebook. It merges cleanly into a branch that has not edited that cell.

18 tests in tests/test_notebook_bootstrap.py (one new: the bootstrap installs through piplite and not /pypi). I have not seen the new CI step run in GitHub Actions yet. Written with AI assistance (Claude Code).

🤖 Generated with Claude Code

… browser check proves it

The bootstrap looked for the bundled wheel in /pypi, which does not exist in the kernel,
so JupyterLite always installed the last release from PyPI. Install through piplite, which
looks in the site's own index first. The Node check stands in for piplite and also plots a
trajectory under ipympl; a new Playwright check builds a site with the wheel and checks
the install, ipywidgets, an ipympl figure and an animation in Chromium.

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

Copy link
Copy Markdown

Not up to standards ⛔

🔴 Issues 4 critical · 6 high · 2 medium · 1 minor

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

Results:
13 new issues

Category Results
Security 1 minor
6 high
4 critical
2 medium

View in Codacy

🟢 Metrics 39 complexity · 0 duplication

Metric Results
Complexity 39
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.

@codecov

codecov Bot commented Oct 21, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 0.00%. Comparing base (6497cdc) to head (95a8d60).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@          Coverage Diff          @@
##            main    #863   +/-   ##
=====================================
  Coverage   0.00%   0.00%           
=====================================
  Files        146     146           
  Lines      17164   17164           
=====================================
  Misses     17164   17164           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

ik_benchmark.ipynb was deleted on main, so its regenerated bootstrap cell goes too, and
docs.yml no longer needs to exclude it from the JupyterLite content.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@petercorke
petercorke enabled auto-merge (squash) October 22, 2026 00:31
@petercorke
petercorke merged commit 126c410 into main Oct 22, 2026
22 of 23 checks passed
@github-actions github-actions Bot mentioned this pull request Oct 22, 2026
@petercorke
petercorke deleted the fix/lite-install-bundled-wheel branch October 22, 2026 04:39
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