Commit 20df602
Route runtests.sh ruff invocations through PY_EXE (#9089)
`runtests.sh` calls every other formatter (black, isort, pylint, pytype)
through `"${PY_EXE}" -m`; the ruff invocations still called a bare
`ruff` off `PATH`. `is_pip_installed ruff` checks `$PY_EXE`, so the
guard and the invocation could disagree — in a clean venv built per
`CONTRIBUTING.md` with no editable `PATH` entry, `./runtests.sh
--codeformat` fails with `ruff: command not found` even though ruff is
installed and importable from `$PY_EXE`.
No behavior change when `ruff` happens to already be on `PATH` (the
common case in an activated venv); this only fixes the case where it
isn't.
<details>
<summary>Reproduced before/after</summary>
With `$PY_EXE` pointed at a venv holding ruff, and that venv absent from
`PATH`:
```
$ MONAI_PY_EXE=/path/to/venv/bin/python bash -c 'PY_EXE=$MONAI_PY_EXE; ruff --version'
bash: line 1: ruff: command not found
$ MONAI_PY_EXE=/path/to/venv/bin/python bash -c 'PY_EXE=$MONAI_PY_EXE; "${PY_EXE}" -m ruff --version'
ruff 0.16.5
```
`./runtests.sh --ruff` with `$PY_EXE` set and the venv not on `PATH` now
reaches `All checks passed!` instead of failing at the version check.
</details>
<!--
provenance: claude-code session 2026-09-03, branch
mono-runtests-ruff-pyexe off dev @ 9ea04d4
related: split out of #9067 (closed) as one of three narrower
follow-ups; see #9067 for the fuller
ODR investigation. Sibling PRs: pyproject extend-exclude + drop
duplicated runtests.sh excludes
(stacked on this branch), and cross-reference comments for
ruff/black/isort pins (independent).
-->
Signed-off-by: Hans Johnson <hans-johnson@uiowa.edu>
Signed-off-by: Eric Kerfoot <17726042+ericspod@users.noreply.github.com>
Co-authored-by: Eric Kerfoot <17726042+ericspod@users.noreply.github.com>1 parent 83e0dde commit 20df602
1 file changed
Lines changed: 3 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
619 | 619 | | |
620 | 620 | | |
621 | 621 | | |
622 | | - | |
| 622 | + | |
623 | 623 | | |
624 | 624 | | |
625 | 625 | | |
626 | | - | |
| 626 | + | |
627 | 627 | | |
628 | | - | |
| 628 | + | |
629 | 629 | | |
630 | 630 | | |
631 | 631 | | |
| |||
0 commit comments