Route runtests.sh ruff invocations through PY_EXE - #9089
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Team Run ID: 📒 Files selected for processing (1)
Included review availability: Your plan provides up to 8 included reviews per hour; 7 remain after this review. 📝 WalkthroughWalkthrough
Estimated code review effort: 1 (Trivial) | ~3 minutes Merge Risk: ⚪ Minimal · up to Ruff now consistently runs through the configured Python interpreter, avoiding PATH-dependent failures while preserving existing check options. The change is ready to merge. 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
Full details: Description checkExplanation The description clearly explains the PATH-related failure, the cause, the fix, the behavior impact, and a before/after reproduction. It provides sufficient context despite omitting the template checklist and issue reference. Full details: Docstring CoverageExplanation No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 1 files. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
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>
303842d to
2da2aed
Compare
runtests.shcalls every other formatter (black, isort, pylint, pytype) through"${PY_EXE}" -m; the ruff invocations still called a bareruffoffPATH.is_pip_installed ruffchecks$PY_EXE, so the guard and the invocation could disagree — in a clean venv built perCONTRIBUTING.mdwith no editablePATHentry,./runtests.sh --codeformatfails withruff: command not foundeven though ruff is installed and importable from$PY_EXE.No behavior change when
ruffhappens to already be onPATH(the common case in an activated venv); this only fixes the case where it isn't.Reproduced before/after
With
$PY_EXEpointed at a venv holding ruff, and that venv absent fromPATH:./runtests.sh --ruffwith$PY_EXEset and the venv not onPATHnow reachesAll checks passed!instead of failing at the version check.