Skip to content

fix(docs): install spatialmath and pgraph with deps=False in JupyterLite - #133

Merged
petercorke merged 1 commit into
mainfrom
fix/jupyterlite-spatialmath-deps
Oct 13, 2026
Merged

petercorke merged 1 commit into
mainfrom
fix/jupyterlite-spatialmath-deps

Conversation

@petercorke

Copy link
Copy Markdown
Owner

Problem

The docs `build` check (and the live in-browser demo) fails: `micropip.install('spatialmath-python')` raises `ValueError: Requested 'packaging>=26.3', but packaging==24.2 is already installed`.

Cause: spatialmath-python 1.1.18 lists `pre-commit` (a dev tool) as a runtime dependency; `pre-commit` -> `virtualenv` 21.14.7 -> `packaging>=26.3`, and Pyodide ships `packaging` 24.2. It started failing when virtualenv 21.14.7 was published, with no change in this repo. RTB and bdsim fail the same way (reproduced in Pyodide 0.27.6).

Upstream fix: rai-opensource/spatialmath-python#250.

Change

In `docs/notebooks/_mvtb_nb_bootstrap.py`, install `spatialmath-python` and `pgraph-python` (which depends on spatialmath) with `deps=False`, and add their real runtime dependencies (numpy, scipy, matplotlib, typing_extensions) to the seed list. Notebook bootstrap cells regenerated with `sync_bootstrap.py`.

Temporary: revert once a spatialmath release without that dependency is out.

Testing

  • `tests/test_notebook_bootstrap.py` passes; `sync_bootstrap.py --check` and `clear_outputs.py --check` are clean.
  • Built the wheel and ran `docs/lite/wasm_check/check_pyodide_install.mjs` (real Pyodide 0.27.6): PASS, `import machinevisiontoolbox: OK`.

🤖 Generated with Claude Code

spatialmath-python 1.1.18 lists pre-commit as a runtime dependency; its
virtualenv requires packaging>=26.3, which conflicts with the packaging
24.2 built into Pyodide, so micropip.install fails in the browser and the
docs build's Pyodide install check goes red.  pgraph-python depends on
spatialmath-python so has the same problem.

Install both with deps=False and list their real runtime dependencies in
the seed list.  Remove once spatialmath drops the dependency
(rai-opensource/spatialmath-python#250) and a release is out.

Notebook bootstrap cells regenerated with sync_bootstrap.py.

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 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.

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