Resolve python3 in the installers instead of bare python - #3
Open
stealthdigital wants to merge 1 commit into
Open
Resolve python3 in the installers instead of bare python#3stealthdigital wants to merge 1 commit into
stealthdigital wants to merge 1 commit into
Conversation
install.sh and uninstall.sh invoked bare `python` for the Gemini loader edit. macOS has shipped no `python` since Monterey removed the Python 2 stub, so `./install.sh --target all` exited 127 after copying five skill trees, leaving a half-installed surface and no loader. uninstall.sh failed at the same point and stranded the loader block in GEMINI.md. Both scripts now resolve an interpreter lazily, preferring python3 and falling back to python only when it is Python 3, so --help still works where no interpreter exists at all. CI could not catch this: actions/setup-python puts a `python` on PATH, as does any active virtualenv. The added regression test builds a sanitized PATH carrying python3 and the utilities the scripts call, with no `python` under any name, and round-trips install and uninstall through it. It fails with "line 80: python: command not found" against the unpatched scripts. Co-Authored-By: Claude Opus 5 (1M context) <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.
The bug
install.sh:80anduninstall.sh:48invoke barepythonfor the Gemini loader edit. macOS has shipped nopythonsince Monterey removed the Python 2 stub, so on a stock Mac:Five skill trees are already on disk at that point, so the failure is a half install rather than a clean abort.
uninstall.shfails at the same step and leaves theanti-slop-brain-installblock stranded insideGEMINI.md.I hit this running
tests/test_pipeline.pyafter a fresh clone, which is where it surfaces asAssertionError: command failed: bash install.sh --target all.The fix
Both scripts resolve an interpreter through a small
resolve_pythonhelper:python3first, thenpythononly when it reports major version 3. Resolution is lazy rather than at startup, so--helpstill works on a machine with no interpreter at all, and a machine with none gets a named error instead ofcommand not found.Why CI is green on a broken installer
actions/setup-pythonputs apythonon PATH, and so does any active virtualenv, so the existing ambient-PATH run inmainpasses on the runner and on most developer machines. Per CONTRIBUTING, the added test fails before the fix and passes after: it builds a sanitized PATH carryingpython3and the utilities the scripts shell out to, with nopythonunder any name, then round-trips install and uninstall through it.Reverting only the two shell files, with the test kept:
Verification
Run on macOS 15.5, stock PATH, no shim, Python 3.12.
python3 tests/test_scanners.pypython3 tests/test_adapters.pypython3 tests/test_pipeline.pypython3 -m compileall -q scripts testspython3 scripts/lint_voice.pyon the three changed filesinstall.sh --target allthenuninstall.sh --target allNo em dash, no en dash, no spaced double hyphen, no local absolute paths in the diff.
Out of scope, flagged rather than fixed
Bare
pythonalso appears inAGENTS.md,CLAUDE.md,README.md,SKILL.md,RELEASE_CHECKLIST.mdand bothci.ymlfiles. The workflows are fine, since the runner providespython, and the docs are copy-paste papercuts rather than runtime failures. Happy to sweep them in a separate PR if you want the docs consistent with CONTRIBUTING, which already usespython3throughout.Also noted while testing:
scan_packages.pyusessys.stdlib_module_names, which needs Python 3.10 or newer. On macOS system Python 3.9 it raisesAttributeError. That is a separate issue and I have not touched it.🤖 Generated with Claude Code