Skip to content

microskills: read the Windows py launcher as the Python interpreter - #341

Open
Lanre Shittu (Shizoqua) wants to merge 1 commit into
microsoft:mainfrom
Shizoqua:fix-microskills-py-launcher
Open

Lanre Shittu (Shizoqua) wants to merge 1 commit into
microsoft:mainfrom
Shizoqua:fix-microskills-py-launcher

Conversation

@Shizoqua

Copy link
Copy Markdown
Contributor

py runs the default Python, or the one a -V:<tag> or -3.x option chooses (CPython's "Using Python on Windows": "To launch your default runtime, run python or py"). The observer read python.exe and C:\Python312\python.exe as the interpreter but not py, so py -m pytest was not observed, and a repository whose tests run that way never got a fact about them.

Fix: py (also py.exe, by path) is one of the Python interpreters. Its version option stays in the form, py -3.12 -m pytest, since it chooses which Python runs. py.test (pytest's own name) and pyright are read as before, and 48 other commands classify the same before and after. The loop guard's side of py is a separate PR.

Tests, in a new tests/test_observe_py_launcher.py:

  • 8 py commands read as test runs, an interpreter run or an environment probe, with the version option kept (all fail on main);
  • py.test, pyright and python -m pytest read as before;
  • end to end through EnvFactsDistiller on four made-up Codex sessions where python -m pytest fails and py -3.12 -m pytest passes: the rendered block names py -3.12 -m pytest. It fails on main and passes with the fix.
python -m pytest tests -n 4 --dist worksteal -rfEs --tb=line
1579 passed, 41 skipped

The skips need Windows, a real agent CLI (Codex, Hermes, opencode) or aider, or a non-root user.

Fixes #340

`py` runs the default Python, or the one a `-V:<tag>` or `-3.x` option chooses (CPython's "Using
Python on Windows": "To launch your default runtime, run `python` or `py`"). The observer read
`python.exe` and `C:\Python312\python.exe` as the interpreter but not `py`, so `py -m pytest` was
not observed, and a repository whose tests run that way never got a fact about them.

`py` (also `py.exe`, by path) is now one of the Python interpreters. Its version option stays in
the form, `py -3.12 -m pytest`, since it chooses which Python runs. `py.test` (pytest's own name)
and `pyright` are read as before.
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.

microskills: the Windows py launcher is not read as the Python interpreter

1 participant