From e213eae71aad91341842291ecb00887f0014b8cd Mon Sep 17 00:00:00 2001 From: Hans Johnson Date: Thu, 3 Sep 2026 09:59:13 -0500 Subject: [PATCH] BUG: Route runtests.sh ruff invocations through PY_EXE runtests.sh calls every other formatter (black, isort, pylint, pytype) via "${PY_EXE}" -m so it targets the same interpreter the is_pip_installed() guard checked. The ruff invocations still called a bare `ruff` off PATH, so is_pip_installed("ruff") could pass against $PY_EXE while the invocation ran a different (or absent) ruff from PATH. 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. Reproduced: with $PY_EXE pointed at a venv holding ruff and that venv absent from PATH, the old `ruff --version` failed with "command not found"; "${PY_EXE}" -m ruff --version succeeded. Signed-off-by: Hans Johnson --- runtests.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/runtests.sh b/runtests.sh index 0fc18b36ec..ebfabe993e 100755 --- a/runtests.sh +++ b/runtests.sh @@ -595,13 +595,13 @@ then then install_deps fi - ruff --version + "${PY_EXE}" -m ruff --version if [ $doRuffFix = true ] then - ruff check --fix --unsafe-fixes --exclude versioneer.py --exclude "monai/_version.py" "$homedir" + "${PY_EXE}" -m ruff check --fix --unsafe-fixes --exclude versioneer.py --exclude "monai/_version.py" "$homedir" else - ruff check --exclude versioneer.py --exclude "monai/_version.py" "$homedir" + "${PY_EXE}" -m ruff check --exclude versioneer.py --exclude "monai/_version.py" "$homedir" fi ruff_status=$?