Skip to content

fix: reset example notebook kernelspec to python3 - #1254

Merged
kylebarron merged 1 commit into
mainfrom
fix/notebook-kernelspec
Sep 30, 2026
Merged

kylebarron merged 1 commit into
mainfrom
fix/notebook-kernelspec

Conversation

@kylebarron

@kylebarron kylebarron commented Aug 31, 2026 •

Copy link
Copy Markdown
Member

Written by claude code

Jupyter records the last kernel that ran a notebook in its metadata, so saving from a locally-registered kernel (e.g. one pointing at this repo's .venv) persists that kernel's name into the committed file.

JupyterLab resolves that saved name against the full kernel search path, and the user-level kernel directory stays on that path even though juv run prepends its ephemeral environment via JUPYTER_PATH. A notebook stamped with a machine-specific kernel therefore executes in that kernel's environment rather than the one juv run built from the notebook's PEP 723 metadata, and its declared dependencies appear to be missing.

Reset the 18 affected notebooks to the generic python3 kernelspec, whose argv is a bare python and so inherits whichever environment launched Jupyter. Add a pre-commit hook so a future save can't reintroduce it.

Jupyter records the last kernel that ran a notebook in its metadata, so
saving from a locally-registered kernel (e.g. one pointing at this repo's
.venv) persists that kernel's name into the committed file.

JupyterLab resolves that saved name against the full kernel search path,
and the user-level kernel directory stays on that path even though `juv
run` prepends its ephemeral environment via JUPYTER_PATH. A notebook
stamped with a machine-specific kernel therefore executes in that kernel's
environment rather than the one `juv run` built from the notebook's PEP
723 metadata, and its declared dependencies appear to be missing.

Reset the 18 affected notebooks to the generic `python3` kernelspec, whose
argv is a bare `python` and so inherits whichever environment launched
Jupyter. Add a pre-commit hook so a future save can't reintroduce it.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
@ds-release-bot ds-release-bot Bot added the fix label Aug 31, 2026
@kylebarron
kylebarron merged commit c13f2c0 into main Sep 30, 2026
6 checks passed
@kylebarron
kylebarron deleted the fix/notebook-kernelspec branch September 30, 2026 00:24
kylebarron added a commit that referenced this pull request Sep 30, 2026
> [!NOTE]
> This PR was written by Claude (Claude Code), not by @kylebarron.

Fixes the failing `Python test` workflow on `main`.

The `normalize-notebook-kernelspec` pre-commit hook added in #1254
requires every notebook's kernelspec to be exactly `{"display_name":
"Python 3 (ipykernel)", "language": "python", "name": "python3"}`.
`examples/geohash-layer.ipynb` (added in #1242) has `"display_name":
"Python 3"`, so the hook rewrites it and fails the `tests (3.11)` job,
which is the job that runs pre-commit.

#1254's PR CI passed because its base branch was older than #1242, so
the geohash notebook wasn't there to check. The two changes only met
after both merged.

This PR is the output of running the hook itself: a one-line change to
`display_name`. It's the only notebook in the repo that didn't already
match.

`uv run pre-commit run --all-files` passes locally with this change.

The earlier failure on the #1292 push was a separate, transient network
error (`uv sync` couldn't download the `pyogrio` wheel from PyPI) and
needs no change.

🤖 Written by [Claude Code](https://claude.com/claude-code)

Co-authored-by: Claude Opus 5.5 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant