Skip to content

Colab-first dependencies, vendored plotting helpers, Colab smoke tests - #10

Merged
patnr merged 4 commits into
masterfrom
colab-compat
Sep 15, 2026
Merged

patnr merged 4 commits into
masterfrom
colab-compat

Conversation

@patnr

@patnr patnr commented Sep 15, 2026

Copy link
Copy Markdown
Owner

Summary

  • Vendor the three mpl-tools helpers actually used (freshfig, nRowCol, is_notebook) into tools/plotting.py, using only stable API; drop mpl-tools.
  • Dependency policy documented in pyproject.toml: Colab-preinstalled packages unconstrained, uv.lock for local reproducibility, requirements-colab.txt + pip install --no-deps on Colab so nothing already imported gets reinstalled (no runtime restart), and no PEP 517 build just to read a dependency list.
  • Drop jupyterlab~=3.6, ipympl, jupyter_nbextensions_configurator and the jupyter-server<2 pin; dev frontend is notebook 7.
  • Smoke tests in tests/colab/ running inside Google's published Colab runtime image (bootstrap, freeze diff, execute both notebooks), via the colab-compat workflow: monthly, on PRs, and on pushes to master touching Colab files.

Test plan

  • Both notebooks execute headlessly in the new local env (tests/colab/run_nb.py).
  • colab-compat workflow passes on this PR.

🤖 Generated with Claude Code

patnr and others added 4 commits September 15, 2026 09:53
Dependencies:
- pyproject.toml documents why Colab-preinstalled packages are unconstrained
  and where reproducibility comes from (uv.lock locally).
- colab_bootstrap.sh installs requirements-colab.txt with --no-deps: only what
  Colab lacks, never touching preinstalled (already imported) packages, so no
  runtime restart. Also no more PEP 517 build just to read a dependency list.
- Runtime deps now list what the notebooks import; jupyter moved to dev.
- Dropped jupyterlab~=3.6, ipympl, jupyter_nbextensions_configurator and the
  jupyter-server<2 pin they forced. Dev frontend is now notebook 7.
- No [build-system]; [tool.uv] package = false.

Vendoring:
- freshfig, nRowCol and is_notebook (was mpl_tools.is_notebook_or_qt) were the
  only things used from mpl-tools; rewritten in tools/plotting.py using only
  stable, public matplotlib/IPython API. mpl-tools kept breaking on Colab's
  matplotlib upgrades via its use of internals.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Run inside Google's published Colab runtime image: bootstrap, check that no
preinstalled package changed (the restart hazard), execute both notebooks.
Monthly cron catches Colab's upgrades; also on PRs/pushes touching Colab files.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
`minires~=0.3.0` replaces the git-commit pin, in `pyproject.toml`,
`requirements-colab.txt` and the lockfile. minires is 0.x, so a minor bump
may break the API; the pin therefore advances deliberately, with the
notebooks checked against the new version.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
nbclient's asyncio loop intermittently misses the execute-reply of cells
that emit a burst of ipywidgets comm messages (our interact/toggle_items
cells), stalling for the full per-cell timeout ~50% of the time. Seen with
nbclient 0.11, jupyter_client 8.10, pyzmq 25-27, ipykernel 6 and 7.
The blocking client polls synchronously and is unaffected (8/8 fast).
Also: -v prints each cell with its duration; timeouts are failures.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@patnr
patnr merged commit ebd17cd into master Sep 15, 2026
1 check passed
@patnr
patnr deleted the colab-compat branch September 15, 2026 13:40
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