Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
83 changes: 0 additions & 83 deletions .githooks/pre-commit

This file was deleted.

8 changes: 5 additions & 3 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,12 @@ jobs:
with:
python-version: "3.12"

- name: Check notebook bootstrap cells and outputs are in sync
# the hooks of .pre-commit-config.yaml, from rvc-ecosystem: notebook outputs are
# cleared, the generated bootstrap cell is current, the first cell is well formed
- name: Check the notebooks
run: |
python docs/notebooks/sync_bootstrap.py --check
python docs/notebooks/clear_outputs.py --check
python -m pip install pre-commit
pre-commit run --all-files --show-diff-on-failure

- name: Install system dependencies
run: sudo apt-get install -y graphviz
Expand Down
11 changes: 11 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# The checks that keep the notebooks in docs/notebooks in step, from rvc-ecosystem:
# outputs cleared, the generated bootstrap cell up to date, the first cell well formed.
# See docs/notebooks/README.md. Install the hooks once with: pre-commit install
# CI runs the same hooks (docs.yml).
repos:
- repo: https://github.com/petercorke/rvc-ecosystem
rev: d21147cc356c167511e4b92b43edc54be35a37d9 # main on 2026-11-20; a tag (v1) once there is one
hooks:
- id: notebooks-clear-outputs
- id: notebooks-sync-bootstrap
- id: notebooks-first-cell
2 changes: 1 addition & 1 deletion docs/lite/browser_check/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

Opens the JupyterLite site in real browsers (Playwright: Chromium and WebKit, the
engine behind Safari), waits for the Pyodide kernel, runs `intro.ipynb`'s bootstrap
cell, and requires its `Running in browser using MVTB v...` line. It also fails if
cell, and requires its `Running in browser using machinevision-toolbox-python v...` line. It also fails if
JupyterLab itself does not start (`Plugin '...' failed to activate`), which happens
before any kernel exists.

Expand Down
4 changes: 2 additions & 2 deletions docs/lite/browser_check/check_lite_in_browser.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

Opens a notebook in a fresh browser context, waits for the Pyodide kernel, runs the
notebook's bootstrap cell (the first code cell) and requires its status line
``Running in browser using MVTB v...`` to appear. Also fails if JupyterLab itself
``Running in browser using machinevision-toolbox-python v...`` to appear. Also fails if JupyterLab itself
could not start (``Plugin '...' failed to activate`` console errors), which happens
before any kernel exists and which the Node/Pyodide install check cannot see.

Expand All @@ -26,7 +26,7 @@
from playwright.sync_api import TimeoutError as PlaywrightTimeout
from playwright.sync_api import sync_playwright

SUCCESS_TEXT = "Running in browser using MVTB"
SUCCESS_TEXT = "Running in browser using machinevision-toolbox-python"
APP_FAILURE_MARKERS = ("failed to activate", "No setting registry")


Expand Down
16 changes: 9 additions & 7 deletions docs/lite/wasm_check/check_pyodide_install.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -54,15 +54,17 @@ sys.path.insert(0, "/")
import micropip
import _mvtb_nb_bootstrap as bootstrap

# Test-only scaffolding: redirect the one HTTP/relative-URL install call to
# the wheel already mounted in Pyodide's own virtual filesystem, so this
# check doesn't need to fake a browser Web Worker's base URL (see this
# file's module docstring for why that's out of scope here). Everything
# else -- the seed-package installs, which is what this check actually
# exists to catch drift in -- runs completely unmodified.
# Test-only scaffolding: in JupyterLite the bootstrap installs the toolbox with
# piplite, which finds the wheel built with the site. Node has no piplite, so the
# bootstrap falls back to micropip, which would install the last release from PyPI.
# Redirect that one install to the wheel already mounted in Pyodide's own virtual
# filesystem, so the check tests the wheel just built and doesn't need to fake a
# browser Web Worker's base URL (see this file's module docstring for why that's out
# of scope here). Everything else -- the seed-package installs, which is what this
# check actually exists to catch drift in -- runs completely unmodified.
_real_install = micropip.install
async def _redirect_wheel_install(requirements, **kwargs):
if isinstance(requirements, str) and requirements.startswith("pypi/"):
if requirements == bootstrap.PACKAGE:
requirements = "emfs:/${wheelName}"
return await _real_install(requirements, **kwargs)
micropip.install = _redirect_wheel_install
Expand Down
Loading
Loading