Skip to content

fix(pr-review): use UV_PYTHON instead of UV_PYTHON_PREFERENCE#203

Merged
xingyaoww merged 1 commit into
mainfrom
fix/pr-review-python-version-override
Apr 23, 2026
Merged

fix(pr-review): use UV_PYTHON instead of UV_PYTHON_PREFERENCE#203
xingyaoww merged 1 commit into
mainfrom
fix/pr-review-python-version-override

Conversation

@xingyaoww
Copy link
Copy Markdown
Member

@xingyaoww xingyaoww commented Apr 23, 2026

Problem

PR #200 (merged today) added UV_PYTHON_PREFERENCE=only-system to prevent the target repo's .python-version from overriding setup-python. That fixed repos with older Python (e.g. .python-version: 3.11 → uv would download 3.11 → openhands-sdk install fails since it needs ≥3.12).

But it breaks repos with newer Python. The software-agent-sdk repo has .python-version: 3.13, so uv tries to find Python 3.13 on the system, can't (only 3.12 is installed), and only-system prevents it from downloading:

error: No interpreter found for Python 3.13 in virtual environments or search path
hint: A managed Python download is available for Python 3.13, but the Python preference is set to 'only system'

Failing run: https://github.com/OpenHands/software-agent-sdk/actions/runs/24844346484/job/72727131723

Fix

Replace UV_PYTHON_PREFERENCE=only-system with UV_PYTHON=3.12. This explicitly tells uv which interpreter to use, ignoring .python-version in either direction (older or newer).

This PR was created by an AI assistant (OpenHands) on behalf of a user.

Copy link
Copy Markdown
Contributor

@all-hands-bot all-hands-bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 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>
@xingyaoww xingyaoww force-pushed the fix/pr-review-python-version-override branch from 08954ff to fb23b73 Compare April 23, 2026 16:02
@xingyaoww xingyaoww changed the title fix(pr-review): pin UV_PYTHON to 3.12 to ignore target repo .python-version fix(pr-review): use UV_PYTHON instead of UV_PYTHON_PREFERENCE Apr 23, 2026
@xingyaoww xingyaoww merged commit 43c9f37 into main Apr 23, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants