Skip to content

Template 0.1.42: exclude menuinst 2.5.2; bump a wrapped conclusion_text - #66

Merged
guijacquemet merged 1 commit into
mainfrom
claude/menuinst-and-wrapped-version
Dec 2, 2026
Merged

guijacquemet merged 1 commit into
mainfrom
claude/menuinst-and-wrapped-version

Conversation

@guijacquemet

Copy link
Copy Markdown
Collaborator

Template 0.1.42, with migration 0.1.41 -> 0.1.42. Design note: .tools/docs/migration_0_1_42.md (not listed in the docs README, like the other design notes).

1. menuinst 2.5.2 is excluded

menuinst 2.5.2 writes Icon={_escape_desktop_string(self.render_key('icon')} into Linux .desktop files without rendering it, so the app's menu entry has no icon. A real install confirmed it: 2.5.1 writes the icon path and 2.5.2 writes the broken line. The fix is merged upstream (conda/menuinst#535) but not released yet. environment.yaml changes from - menuinst>=2 to - menuinst>=2,!=2.5.2.

2. A wrapped conclusion_text now gets its version bumped

bump_construct_text in .tools/python/bump_version.py updated the version in conclusion_text only when the value was on one line. For a long project name, the repository initialiser writes the value wrapped as a plain multi-line scalar:

conclusion_text: Thank you! You have successfully installed LabConstrictor-CAREamics
  0.0.2.

That value was never updated, so the installer's last page named the previous version. This happened to LabConstrictor-CAREamics 0.0.3. The new join_wrapped_conclusion first joins the continuation lines into one line, which is how YAML reads them: the non-blank lines more indented than the key. The existing one-line update then runs, so the release writes the value on one line with the new version. These cases behave as before: a quoted one-line value, a bare one-line value and the VERSION_NUMBER placeholder. A quoted or block (|/>) value is not joined. CRLF is kept.

What the migration does to an app

  • environment.yaml: only one line changes (a line-level edit, so the app's other lines stay as they are).
    • - menuinst>=2 becomes - menuinst>=2,!=2.5.2, keeping any trailing comment and the file's line endings.
    • If the line is already menuinst>=2,!=2.5.2, the file is reported as already up to date.
    • Any other menuinst requirement is left as it is. The file is reported as SKIPPED, with what to change by hand.
    • If there is no menuinst line, a note says so and nothing is added.
  • bump_version.py: replaced whole when it is still the 0.1.41 template file. This is compared with LF line endings against the frozen copy in .template_sync/resources/v0_1_41_to_v0_1_42/previous/. The file keeps its own line endings. A customised file is left as it is and reported as SKIPPED, with what to change by hand.
  • A missing file is not created and nothing is deleted. A second run changes nothing, and the migration never raises (an unreadable file is SKIPPED). construct.yaml itself is not edited: the app's next release writes conclusion_text on one line.

Tests

  • tests/test_template_sync_0_1_42.py covers:
    • the manifest and the migration chain;
    • the design note;
    • the resources: the live file plus the frozen 0.1.41 copy;
    • the live environment.yaml excluding 2.5.2;
    • before_0_1_42;
    • migrating a 0.1.41 app with LF and with CRLF line endings, and that a second run changes nothing;
    • a customised environment.yaml, where only the menuinst line changes;
    • other menuinst specs, which are skipped;
    • an environment.yaml with no menuinst line;
    • a customised bump_version.py, which is skipped;
    • missing files and an unreadable file;
    • a sync from 0.1.41;
    • bump_construct_text on a wrapped plain scalar (0.0.2 -> 0.0.3 gives one line with 0.0.3, LF and CRLF), a value wrapped from the key line, a one-line quoted value, a one-line bare value and the VERSION_NUMBER placeholder, and that the 0.1.41 script missed the wrapped value.
  • tests/_v0_1_42.py (before_0_1_42) is called first by _v0_1_41.before_0_1_41, so the older tests keep seeing the 0.1.41 files. tests/test_template_sync_0_1_25.py now compares bump_version.py with the file as 0.1.25 left it, not with the live file, following the same pattern as at_0_1_31 in the 0.1.31 tests.
  • With the CI toolchain (Python 3.11 and the pinned pytest, ruff and mypy from .github/workflows/tests.yml):
    • python -m pytest tests -q: 588 passed, 1599 subtests passed.
    • ruff check .template_sync .tools/python tests: all checks passed.
    • python -m mypy .template_sync .tools/python tests: no issues found in 119 source files.

Generated by Claude Code

environment.yaml asks for menuinst>=2,!=2.5.2: menuinst 2.5.2 writes
Icon={_escape_desktop_string(self.render_key('icon')} unrendered into the
Linux .desktop file, so the menu entry has no icon (conda/menuinst#535,
fixed upstream, not released).

bump_version.py joins a conclusion_text written as a plain scalar over
several lines (the initialiser wraps it for a long project name) before
it updates the version, so the installer's last page names the release
version (LabConstrictor-CAREamics 0.0.3 said 0.0.2).

Migration 0.1.41 -> 0.1.42 changes only the `- menuinst>=2` line of an
app's environment.yaml (another menuinst requirement is skipped with a
by-hand note; no line is added) and replaces bump_version.py when it is
the 0.1.41 template file (a customised one is skipped with a note).
Tests: tests/test_template_sync_0_1_42.py; older tests see the 0.1.41
files through tests/_v0_1_42.py (before_0_1_42).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01G3qp98bPNSUhQXHiLUjA8h
@guijacquemet
guijacquemet merged commit 368aef9 into main Dec 2, 2026
4 checks passed
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.

2 participants