Skip to content

Re-lock every notebook for Colab's Python 3.13 runtime - #206

Merged
bendichter merged 6 commits into
masterfrom
python-313-relock
Aug 23, 2026
Merged

Re-lock every notebook for Colab's Python 3.13 runtime#206
bendichter merged 6 commits into
masterfrom
python-313-relock

Conversation

@bendichter

Copy link
Copy Markdown
Member

Colab switched its default runtime to Python 3.13 on 2026-08-19 (the runtime now reports 3.13.15 (main, Aug 6 2026)). Our install cells were compiled against the 3.12 runtime, and 34 of the 35 pin sets stopped resolving there: ml-dtypes on 3.13 requires numpy>=2.1, and the pinned numpy==2.0.2 has no cp313 wheels, so the first cell failed before any notebook code ran.

What Changes

The Colab constraint file (.github/colab-preinstalled.txt) is refreshed from the current runtime's package list. lock_notebook.py, the Dockerfile base image, and the test and build workflows all move to Python 3.13, and every one of the 44 bootstrap notebooks is re-locked.

Re-locking is driven by requirements.in, and 29 of the 35 image groups predated that contract and had none. A new script, .github/scripts/backfill_requirements.py, derives one for each: it scans the notebooks (and their helper modules) for imports, resolves import names to distribution names inside the group's published container image, and carries over ndx-* packages and pkg @ git+ pins, which an import scan cannot see because they are used through a file's cached schema rather than imported. The generated files are committed, so this is a one-time backfill; future changes go through the normal contract.

Groups that use pynwb are held at pynwb<4, hdmf<5, which is the stack the fleet was last verified on. The re-lock should fix Colab, not double as a pynwb major upgrade; that can be done deliberately per group later. The demos notebook keeps the nwbwidgets-era stack (pynwb<3), and 001550/PaganLab additionally needs pynwb>=3.1 plus its ndx-* extension packages, which I verified locally before generalizing the bounds.

Verification

All 35 pin sets resolve for Python 3.13 on linux in a uv pip install --dry-run with wheels required for every compiled package. 001550/PaganLab ran green end to end locally on 3.13. CI on this PR executes all 44 notebooks on 3.13 runners, which is the real test; I will triage anything that fails here. After merge, the image pipeline rebuilds the whole fleet on the 3.13 base.

The Get-to-know-a-Dandiset tutorial had five outputs with an invalid jetTransient key that made nbformat validation fail; those outputs are removed.

🤖 Generated with Claude Code

https://claude.ai/code/session_011NuStoQykizhQCx2KBrMCN

Colab moved its default runtime to Python 3.13 on 2026-08-19, and the
install cells pinned against the 3.12 runtime stopped resolving there:
ml-dtypes on 3.13 requires numpy>=2.1, and numpy 2.0.2 has no cp313
wheels, so 34 of the 35 pin sets failed at the first cell.

This refreshes the Colab constraint file from the current runtime,
switches the locker, the Dockerfile base, and the CI runners to 3.13,
and re-locks all 44 bootstrap notebooks. The re-lock is driven by
requirements.in files, so every group now has one: the 29 groups that
predated the contract get theirs from a new backfill script that scans
the notebooks' imports, resolves them to distribution names inside the
group's published image, and carries over NWB extension packages and
git pins that an import scan cannot see. Groups that use pynwb are held
at pynwb<4 and hdmf<5 so that the re-lock does not double as a pynwb
major upgrade; the demos notebook keeps the nwbwidgets-era stack.

The Get-to-know-a-Dandiset tutorial had five outputs with an invalid
key that made the notebook fail nbformat validation; they are removed.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011NuStoQykizhQCx2KBrMCN
@review-notebook-app

Copy link
Copy Markdown

Check out this pull request on  ReviewNB

See visual diffs & provide feedback on Jupyter Notebooks.


Powered by ReviewNB

@github-actions

github-actions Bot commented Aug 23, 2026

Copy link
Copy Markdown
Contributor

Preview for this PR has been removed (PR closed).

github-actions Bot added a commit that referenced this pull request Aug 23, 2026
@github-actions

github-actions Bot commented Aug 23, 2026

Copy link
Copy Markdown
Contributor

Executed notebooks

CI executed the notebooks changed in this PR through a Jupyter kernel. Review the outputs here (each link is the notebook with its outputs, as a reader would see it):

Last updated: commit 7af70c71f1a7a209f7d1a72f362274c1f3d57f56. The executed copies live only in the preview and are removed when the PR closes; nothing is committed to the branch.

github-actions Bot added a commit that referenced this pull request Aug 23, 2026
…-lock

The first CI round on the 3.13 re-lock failed 22 notebooks. Fourteen of
those were artifacts of the kernel execution path added in #205 rather
than of the re-lock: nbconvert starts the kernel in the directory of the
notebook file it is given, which was our temporary copy under /tmp, so
helper modules and relative data paths next to the original notebook
were not found; and tqdm.auto raises "IProgress not found" inside a
kernel when ipywidgets is missing, which Colab preinstalls and our
runner did not. The temporary copy now lives beside the original, and
ipywidgets is installed with the harness in kernel mode.

The remaining eight were real drift that the old locks had masked:
pynapple 0.11 removed compute_perievent_continuous and the tref kwarg,
numcodecs 0.16 removed blosc.cbuffer_sizes (used by lindi), and pynwb
3.1 rejects object names containing "/" that the 001038 and 001084
files carry. Each gets an upper bound in its requirements.in. Holding
pynwb below 3.1 in turn needs a dandi release that wants click<8.2,
which conflicts with Colab's click pin, so lock_notebook.py now honours
"# override: <spec>" lines in requirements.in that replace the Colab
constraint for a single package. The MICrONS notebook drops its
nwbwidgets cell, since that package forces a pynwb the server-side
dandi version check no longer accepts.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011NuStoQykizhQCx2KBrMCN
github-actions Bot added a commit that referenced this pull request Aug 23, 2026
…sts on DANDI

cellpose 4 removed models.Cellpose and nemos 0.2.7 changed the solver
kwargs the GLM notebook passes, so both get upper bounds at the versions
the notebooks were written against. The processed widefield notebook
hardcoded a subject that is not in the dandiset, and the anatomical one
defaulted to a local path; both now stream sub-FD-28 from DANDI.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011NuStoQykizhQCx2KBrMCN
github-actions Bot added a commit that referenced this pull request Aug 23, 2026
…on DANDI yet

optimistix 0.1.0 does not work with the jax 0.7.2 that Colab pins, so
the GLM notebook is held at the 0.0.11 it was written against. The
processed and anatomical widefield notebooks need an atlas registration
that the only published 001712 session does not contain, so they are
excluded from CI and from the Colab badge until the data catches up.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011NuStoQykizhQCx2KBrMCN
github-actions Bot added a commit that referenced this pull request Aug 23, 2026
…shes

The checklist comment was assembled once, after the whole matrix had run,
so on a PR that touches many notebooks nothing was visible for an hour.
Each matrix job now deploys its own rendered notebook to the PR preview
through the Contents API (one file per commit, retried on a concurrent
commit, so jobs never race on a git push) and rebuilds the checklist.
The checklist is derived from the run's artifact names, which carry the
result (executed-<slug>-pass/fail/none), so concurrent rebuilds cannot
lose a result; a final job rebuilds it once more after the matrix.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011NuStoQykizhQCx2KBrMCN
github-actions Bot added a commit that referenced this pull request Aug 23, 2026
github-actions Bot added a commit that referenced this pull request Aug 23, 2026
github-actions Bot added a commit that referenced this pull request Aug 23, 2026
github-actions Bot added a commit that referenced this pull request Aug 23, 2026
github-actions Bot added a commit that referenced this pull request Aug 23, 2026
github-actions Bot added a commit that referenced this pull request Aug 23, 2026
github-actions Bot added a commit that referenced this pull request Aug 23, 2026
github-actions Bot added a commit that referenced this pull request Aug 23, 2026
github-actions Bot added a commit that referenced this pull request Aug 23, 2026
github-actions Bot added a commit that referenced this pull request Aug 23, 2026
github-actions Bot added a commit that referenced this pull request Aug 23, 2026
github-actions Bot added a commit that referenced this pull request Aug 23, 2026
github-actions Bot added a commit that referenced this pull request Aug 23, 2026
…group

Committing each executed notebook to gh-pages straight from the matrix
job bypassed the gh-pages-deploy concurrency group, and the first run
rejected the index preview's push. Each matrix job now dispatches a
small deploy workflow instead; it runs in that group, publishes every
executed notebook the run has produced so far with peaceiris, and
rebuilds the checklist. The finalize job does the same once the matrix
is complete, so the end state does not depend on the dispatches, which
resolve the workflow file on the default branch.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011NuStoQykizhQCx2KBrMCN
github-actions Bot added a commit that referenced this pull request Aug 23, 2026
github-actions Bot added a commit that referenced this pull request Aug 23, 2026
github-actions Bot added a commit that referenced this pull request Aug 23, 2026
@bendichter
bendichter merged commit 4e258b0 into master Aug 23, 2026
87 of 88 checks passed
github-actions Bot added a commit that referenced this pull request Aug 23, 2026
github-actions Bot added a commit that referenced this pull request Aug 23, 2026
github-actions Bot added a commit that referenced this pull request Aug 23, 2026
github-actions Bot added a commit that referenced this pull request Aug 23, 2026
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