Replace uv run python with sys.executable in eval scripts#472
Merged
simonrosenberg merged 1 commit intomainfrom Mar 2, 2026
Merged
Replace uv run python with sys.executable in eval scripts#472simonrosenberg merged 1 commit intomainfrom
uv run python with sys.executable in eval scripts#472simonrosenberg merged 1 commit intomainfrom
Conversation
Simpler, removes the hard dependency on uv being available at eval time, and uses the correct Python interpreter in both uv and NeMo environments. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
all-hands-bot
approved these changes
Mar 2, 2026
Collaborator
all-hands-bot
left a comment
There was a problem hiding this comment.
Taste Rating: 🟢 Good taste
This is beautiful simplification. Replacing 16 lines of subprocess gymnastics with sys.executable is exactly right. The old swtbench code was running a subprocess just to discover what Python interpreter to use - which is precisely what sys.executable gives you directly.
The assumption that the Python running the script has the required dependencies is standard practice. CI validates this works.
Verdict: ✅ Ship it
simonrosenberg
added a commit
that referenced
this pull request
Mar 3, 2026
Resolve conflicts after sub-PRs #471, #472, #473 were merged to main: - Take main's SDK_SHORT_SHA deprecation handling in version.py - Take main's backward-compat SDK_SHORT_SHA in modal_patches.py - Take main's log message wording in swebench/run_infer.py - Remove redundant prompt_dir setup (superseded by add_prompt_path_argument) - Keep lazy imports for git-dependent modules (build_utils.py, swtbench/run_infer.py) - Take main's comment cleanup in swtbench/eval_infer.py Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
uv run pythonsubprocess invocations withsys.executableinswebench/eval_infer.py,swtbench/eval_infer.py, andmultiswebench/eval_infer.pyuvbeing available at eval timeExtracted from #455.
Changes
benchmarks/swebench/eval_infer.py["uv", "run", "python", "-m", ...]→[sys.executable, "-m", ...]benchmarks/swtbench/eval_infer.pyuv run python -c "import sys; print(sys.executable)"just to discover the Python path; replaced withpython_executable = sys.executablebenchmarks/multiswebench/eval_infer.py["uv", "run", "python", "-m", ...]→[sys.executable, "-m", ...]; addedimport sysValidation
All affected benchmarks pass CI with
eval_limit=1(from #455 validation):Test plan
swebench-evalruns correctly withoutuvon PATHswtbench-evalruns correctly withoutuvon PATHmulti-swebench-evalruns correctly withoutuvon PATH🤖 Generated with Claude Code