From 626b6c676c2ff590782aee4a36634da867f4a362 Mon Sep 17 00:00:00 2001 From: Claude Date: Fri, 4 Dec 2026 15:15:23 +0000 Subject: [PATCH] 0.1.47 migration: no invalid escape in its docstring (SyntaxWarning at each sync) A test now compiles every .template_sync script with warnings as errors. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01G3qp9AoUT3RtgWWsiVVarX --- .template_sync/migrations/v0_1_46_to_v0_1_47.py | 2 +- tests/test_template_sync_0_1_47.py | 8 ++++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/.template_sync/migrations/v0_1_46_to_v0_1_47.py b/.template_sync/migrations/v0_1_46_to_v0_1_47.py index 2ac914e..47b4945 100644 --- a/.template_sync/migrations/v0_1_46_to_v0_1_47.py +++ b/.template_sync/migrations/v0_1_46_to_v0_1_47.py @@ -11,7 +11,7 @@ 1. app/bash_bat_scripts/pre_uninstall.bat gets six lines just before its line `echo Pre-uninstall completed!`: three REM lines, the app folder (the folder of the script), one PowerShell command that stops every process whose program is inside the app folder (a Jupyter server and its kernels, a Napari or Fiji tool worker), except the uninstaller and its helpers, and waits up to 15 s for each to end, and a line that shows its log - (%TEMP%\labconstrictor_pre_uninstall.log). A script without that line is left as it + (%TEMP%\\labconstrictor_pre_uninstall.log). A script without that line is left as it is (SKIPPED, with what to do by hand). The file keeps its own line endings. Linux and macOS are not changed: a running process does not stop the removal of its files there. The change reaches users with the app's next diff --git a/tests/test_template_sync_0_1_47.py b/tests/test_template_sync_0_1_47.py index a12ab01..d4a640e 100644 --- a/tests/test_template_sync_0_1_47.py +++ b/tests/test_template_sync_0_1_47.py @@ -8,6 +8,7 @@ import sys import tempfile import unittest +import warnings from contextlib import redirect_stdout from io import StringIO from pathlib import Path @@ -63,6 +64,13 @@ def test_the_command_survives_cmd_and_spares_the_uninstaller(self) -> None: for name in ("UNDERSCORED_PROJECT_NAME", "PROJECT_NAME", "BASE_PATH"): self.assertNotIn(name, "".join(MIGRATION.STOP_LINES), "no placeholder: the lines are the same in every app") + def test_every_migration_compiles_without_a_warning(self) -> None: + """An invalid escape such as \\l in a docstring warns at each sync run (SyntaxWarning), which reads as a fault in the sync log.""" + for path in sorted((ROOT / ".template_sync").rglob("*.py")): + with self.subTest(file=path.name), warnings.catch_warnings(): + warnings.simplefilter("error") + compile(path.read_text(encoding="utf-8"), str(path), "exec") + def test_the_manifest_lists_the_migration_and_the_version(self) -> None: text = (ROOT / ".template_sync/manifest.yaml").read_text(encoding="utf-8") self.assertRegex(text, r"template_version: 0\.1\.(4[7-9]|[5-9][0-9])\b")