From 596967e87cf39bd79acae73ccc9135c5924f0241 Mon Sep 17 00:00:00 2001 From: Claude Date: Thu, 6 Aug 2026 13:35:05 +0000 Subject: [PATCH] fix: uncomment setup_notebook for all auto* import forms MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit uncomment_jupyter_magic only matched the autonerves import form, but every workspace and HowTo script writes the line as e.g. '# from autolens import setup_notebook; setup_notebook()' (each library re-exports it). The regex mismatch meant generated notebooks never activated their working-directory setup, which broke notebook execution from a notebook-dir cwd — surfaced by HowToLens markdown renders of dataset-loading tutorials failing to resolve their auto-simulate paths. The substitution now matches any auto* package and preserves it. Co-Authored-By: Claude Fable 5 Claude-Session: https://claude.ai/code/session_01BxKfSZisjnEn91LRGkN4SU --- autohands/build_util.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/autohands/build_util.py b/autohands/build_util.py index 4489e33..b89e25e 100644 --- a/autohands/build_util.py +++ b/autohands/build_util.py @@ -201,8 +201,8 @@ def uncomment_jupyter_magic(f): with open(f, "w") as sources: for line in lines: line = re.sub( - r"# from autonerves import setup_notebook; setup_notebook\(\)", - "from autonerves import setup_notebook; setup_notebook()", + r"# from (auto\w+) import setup_notebook; setup_notebook\(\)", + r"from \1 import setup_notebook; setup_notebook()", line, ) sources.write(line)