fix(pr-review): use UV_PYTHON instead of UV_PYTHON_PREFERENCE#203
Merged
Conversation
all-hands-bot
approved these changes
Apr 23, 2026
Contributor
all-hands-bot
left a comment
There was a problem hiding this comment.
🟢 Good taste - Elegant, targeted fix.
[RISK ASSESSMENT]
- [Overall PR]
⚠️ Risk Assessment: 🟢 LOW
This fix explicitly pins UV_PYTHON to match the installed Python version, preventing uv from being misled by target repos' .python-version files. The solution is minimal, well-documented with a clear comment, and solves a real production failure. No breaking changes, no complexity added.
VERDICT: ✅ Worth merging - Clean fix to a documented issue.
KEY INSIGHT: Explicitly declaring the Python version for uv eliminates environment ambiguity without adding complexity.
PR #200 added UV_PYTHON_PREFERENCE=only-system to prevent the target repo's .python-version from overriding setup-python. This works when .python-version is *older* than 3.12 (e.g. 3.11), but breaks when it is *newer* (e.g. 3.13 in software-agent-sdk) because uv cannot find 3.13 on the system and is not allowed to download it. Replace with UV_PYTHON=3.12 which explicitly tells uv which interpreter to use, ignoring .python-version in either direction. Fixes: https://github.com/OpenHands/software-agent-sdk/actions/runs/24844346484 Co-authored-by: openhands <openhands@all-hands.dev>
08954ff to
fb23b73
Compare
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.
Problem
PR #200 (merged today) added
UV_PYTHON_PREFERENCE=only-systemto prevent the target repo's.python-versionfrom overridingsetup-python. That fixed repos with older Python (e.g..python-version: 3.11→ uv would download 3.11 →openhands-sdkinstall fails since it needs ≥3.12).But it breaks repos with newer Python. The
software-agent-sdkrepo has.python-version: 3.13, souvtries to find Python 3.13 on the system, can't (only 3.12 is installed), andonly-systemprevents it from downloading:Failing run: https://github.com/OpenHands/software-agent-sdk/actions/runs/24844346484/job/72727131723
Fix
Replace
UV_PYTHON_PREFERENCE=only-systemwithUV_PYTHON=3.12. This explicitly tellsuvwhich interpreter to use, ignoring.python-versionin either direction (older or newer).This PR was created by an AI assistant (OpenHands) on behalf of a user.