fix(cli): launch subcommands with the active Python interpreter - #749
Open
imMamdouhaboammar wants to merge 1 commit into
Open
fix(cli): launch subcommands with the active Python interpreter#749imMamdouhaboammar wants to merge 1 commit into
imMamdouhaboammar wants to merge 1 commit into
Conversation
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.
Problem
The
gaconsole script can be installed and run from a virtual environment or another explicit Python interpreter, but every Python-based frontend command inga_cli/cli.pystarts with the literal executable namepython.That can resolve to a different interpreter than the one running
ga, or fail entirely on systems where onlypython3exists. It also conflicts withcmd_update(), which already usessys.executablecorrectly.Fix
Normalize only Python launcher commands inside
launch_frontend(): when the command's first token is exactlypython, replace it withsys.executable. Non-Python runtimes are left untouched.This keeps the command registry readable and avoids editing each command definition separately.
Verification
TDD was performed on a separate validation branch:
31166383679failed becauselaunch_frontend()passedpythoninstead of the active interpreter path; the non-Python launcher case already passed31166445434: compile, both regression tests, andgit diff --checkmainas one clean commit with no temporary CI filesScope
main