Skip to content

fix(cli): launch subcommands with the active Python interpreter - #749

Open
imMamdouhaboammar wants to merge 1 commit into
lsdefine:mainfrom
imMamdouhaboammar:fix/ga-cli-current-python-upstream
Open

fix(cli): launch subcommands with the active Python interpreter#749
imMamdouhaboammar wants to merge 1 commit into
lsdefine:mainfrom
imMamdouhaboammar:fix/ga-cli-current-python-upstream

Conversation

@imMamdouhaboammar

Copy link
Copy Markdown

Problem

The ga console script can be installed and run from a virtual environment or another explicit Python interpreter, but every Python-based frontend command in ga_cli/cli.py starts with the literal executable name python.

That can resolve to a different interpreter than the one running ga, or fail entirely on systems where only python3 exists. It also conflicts with cmd_update(), which already uses sys.executable correctly.

Fix

Normalize only Python launcher commands inside launch_frontend(): when the command's first token is exactly python, replace it with sys.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:

  1. Regression-only GitHub Actions run 31166383679 failed because launch_frontend() passed python instead of the active interpreter path; the non-Python launcher case already passed
  2. The minimal dispatcher fix passed run 31166445434: compile, both regression tests, and git diff --check
  3. This contribution branch is rebuilt directly from current main as one clean commit with no temporary CI files

Scope

  • 1 CLI production file modified
  • 1 focused regression-test file added
  • 1 clean commit on top of current main
  • no dependency or configuration changes

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant