Skip to content

Commit 2da2aed

Browse files
committed
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 <hans-johnson@uiowa.edu>
1 parent 9ea04d4 commit 2da2aed

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

runtests.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -595,13 +595,13 @@ then
595595
then
596596
install_deps
597597
fi
598-
ruff --version
598+
"${PY_EXE}" -m ruff --version
599599

600600
if [ $doRuffFix = true ]
601601
then
602-
ruff check --fix --unsafe-fixes --exclude versioneer.py --exclude "monai/_version.py" "$homedir"
602+
"${PY_EXE}" -m ruff check --fix --unsafe-fixes --exclude versioneer.py --exclude "monai/_version.py" "$homedir"
603603
else
604-
ruff check --exclude versioneer.py --exclude "monai/_version.py" "$homedir"
604+
"${PY_EXE}" -m ruff check --exclude versioneer.py --exclude "monai/_version.py" "$homedir"
605605
fi
606606

607607
ruff_status=$?

0 commit comments

Comments
 (0)