Fix Python 3.9 install crash that silently skipped all shim generation (v2.7.0 regression)#99
Merged
Merged
Conversation
…fails loudly Since v2.7.0 the npx installer delegates all shim/workflow generation to python3 -m _install_pkg.install. manifest.py's ConfigPatch grew a `section: str | None = None` dataclass field (6ce68d2) without `from __future__ import annotations` - PEP 604 unions are evaluated at import time on Python 3.9, so the whole install loop died with TypeError before writing a single CLI shim. macOS ships /usr/bin/python3 3.9.6, so any user without a newer python3 on PATH got a broken install from v2.7.0 through v2.9.0. Worse, archie.mjs swallowed the failure: one dim warning between forty green checkmarks and a 45s viewer build, then 'Installed!' and exit 0. Users reported it as 'the archie files are not generated' (the .py support scripts DO get copied; the slash commands don't). - manifest.py: add the future import (the one-line root-cause fix; verified end-to-end on /usr/bin/python3 3.9.6) - install.py: explicit version gate before package imports - Python <3.9 now gets an actionable message instead of a traceback - archie.mjs: when python3 is missing or the install loop exits non-zero, print a prominent 'Install INCOMPLETE' block and exit 1 instead of 'Installed!' / exit 0 - tests/test_py39_compat.py: AST guard over every shipped .py - any X | Y annotation in a module without the future import fails the suite (py_compile can't catch this and CI has no 3.9 interpreter) Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
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.
Customer impact
Any machine whose
python3is 3.9 (notably the macOS-bundled /usr/bin/python3 3.9.6) gets a broken install from v2.7.0 through v2.9.0:npx @bitraptors/archieprints 'Installed!' and exits 0, but no slash commands or workflow files are written. Reported as 'the archie files are not generated'. Installs that worked on v2.6.0 and earlier (pure-JS shim writing) broke on upgrade. Node version is irrelevant (verified working on Node 26.3).Root cause
manifest.pygainedsection: str | None = None(commit 6ce68d2, shipped in 2.7.0) withoutfrom __future__ import annotations. PEP 604 unions in class bodies are evaluated at import time on Python 3.9 ->TypeError: unsupported operand type(s) for |->python3 -m _install_pkg.installdies before writing anything.archie.mjsthen swallowed the non-zero exit with a single dim warning and still reported success.Fix
manifest.py: add the future import (root cause, one line)install.py: version gate before package imports - Python <3.9 gets an actionable message, exit 3archie.mjs: missing python3 or a failed install loop now prints a prominent 'Install INCOMPLETE - no Claude/Codex commands were written' block and exits 1tests/test_py39_compat.py: AST regression guard over every shipped .py - flags any runtime-evaluated union annotation in a module lacking the future import (works on any CI python; py_compile cannot catch this class)Verification
scripts/verify_sync.pypassesNeeds a v2.9.1 npm release once merged to actually reach the customer.
Generated with Claude Code