Repository navigation
Template 0.1.31: no silent change of a notebook's package versions, no lost work when a notebook is updated - #55
Merged
Conversation
…o lost work when a notebook is updated - #48: merge_requirements.py keeps requirements as written and combines them per package (names compared as pip compares them). Different exact pins, a pin outside another notebook's range, or ranges no version meets stop the merge before any file is written, naming every notebook and requirement. requirements_overrides.yaml decides explicitly, with a required reason, written at the top of the generated files. Different markers stay separate lines; OS-specific lists are checked against the common ones. --check only looks for conflicts. packaging==25.0 in .tools/requirements.txt. - The release runs merge_requirements.py --check after check_placeholders.py; a push of requirements_overrides.yaml runs the notebook workflow's merge again. - #49: the Welcome notebook's Update asks first, keeps the current notebook as <notebook>.backup-<date>.ipynb, writes the new one atomically and records the new version only after that. Cancel or any failure changes nothing; a private repository without a token no longer crashes the button. - Migration v0_1_29_to_v0_1_30.py: replaces the 0.1.29 merge script, adds packaging, creates requirements_overrides.yaml where notebooks already pin different versions (keeping the version used until now), updates the two workflows and the Welcome template's update handler; SKIPPED for customised files. - Design note migration_0_1_30.md, docs, tests (tests/test_template_sync_0_1_30.py; tests/_v0_1_30.py keeps the older frozen-resource tests comparable). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
main's 0.1.30 (the site's GitHub Pages address) is kept as it is. The requirements and notebook-update change moves to 0.1.31: migration v0_1_30_to_v0_1_31.py, resources v0_1_30_to_v0_1_31, design note migration_0_1_31.md, tests/_v0_1_31.py and tests/test_template_sync_0_1_31.py, the frozen Welcome template in tests/fixtures/template_0_1_30. before_0_1_30 of main takes out the 0.1.31 change first, so the older frozen-resource tests keep comparing as before; test_template_sync_0_1_30 accepts a later template version. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #48, fixes #49. Design note:
.tools/docs/migration_0_1_31.md.Policies (approved by @IvanHCenalmor on 2026-11-16, as both issues asked)
requirements_overrides.yaml, with a required reason;#48: what the merge did, reproduced
numpy==1.26.4numpy==2.0.0numpy==2.0.0, either file ordernumpy<2.0numpy==2.0: every requirement was written as==numpy<2numpy>=2.1numpy==2.1numpy==1.26.4 ; win32numpy==2.0.0 ; not win32Also found:
scikit-imageandscikit_imagewere treated as two packages, giving two lines that pip refuses;ipywidgets==>=7.0.0was written when no notebook gave a Python version.Changes
merge_requirements.py:requirements_overrides.yamldecisions (useplus a requiredreason) are written at the top of every generated file;--checkonly looks for conflicts;build_gpu_lines/tensorflow_gpu_linesare unchanged.satisfiable()is our own check because a failed lock is only a warning: the installer would then install the unlocked file..tools/requirements.txt:packaging==25.0.release_constructor.yml:merge_requirements.py --checkaftercheck_placeholders.pyin the bump-version job. A failed merge leaves the oldrequirements.txt, which would otherwise be released.update_on_notebook_change.yml: a push ofrequirements_overrides.yamlruns the workflow and the merge.Welcome_template.ipynb, the Update button:<notebook>.backup-<date>.ipynb, never overwriting an earlier backup;Cancel or any failure changes nothing. A private repository without a token no longer crashes the button. The app-version gate is unchanged.
Migration
v0_1_30_to_v0_1_31.py:packaging, and createsrequirements_overrides.yamlonly where notebooks already pin different versions;--check;Docs:
notebook_requirements.md(new section on conflicts),notebook_upload.md,notebook_usage.md(updating a notebook), and both troubleshooting pages.Tests:
tests/test_template_sync_0_1_31.py(35 tests);tests/_v0_1_31.pyundoes the 0.1.31 changes for the older frozen-resource tests, with the 0.1.30 Welcome template frozen intests/fixtures/template_0_1_30/.Verified
main(bash and path-separator tests) and no new ones; the 35 new tests pass.cellpose,ipywidgets,scikit-image,tifffile,torch,zarr), and LabChronicle 1 (tqdm).check_placeholders.py.numpy<2,>=2.1("you require numpy<2 and numpy>=2.1, which are incompatible").Not verified
🤖 Generated with Claude Code