fix(pr-review): use both UV_PYTHON and UV_PYTHON_PREFERENCE#204
fix(pr-review): use both UV_PYTHON and UV_PYTHON_PREFERENCE#204xingyaoww wants to merge 1 commit into
Conversation
UV_PYTHON=3.12 alone is not sufficient — uv still downloads the version from .python-version when managed downloads are allowed. Restore UV_PYTHON_PREFERENCE=only-system alongside UV_PYTHON=3.12: - UV_PYTHON=3.12: tells uv which version to request - only-system: prevents uv from downloading a different version Together they handle .python-version in both directions: - Older (e.g. 3.11): only-system blocks the download, UV_PYTHON selects 3.12 - Newer (e.g. 3.13): only-system blocks the download, UV_PYTHON selects 3.12 Co-authored-by: openhands <openhands@all-hands.dev>
all-hands-bot
left a comment
There was a problem hiding this comment.
🟢 Good taste — Elegant fix that uses both env vars complementarily to handle .python-version in either direction. Solves a real production problem with minimal, well-documented change.
[RISK ASSESSMENT]
[Overall PR]
Configuration-only change with limited blast radius. Restores working behavior for repos with older Python versions while maintaining the fix for newer versions. No security concerns, infrastructure changes, or architectural shifts.
✅ Worth merging
KEY INSIGHT: The combination of UV_PYTHON=3.12 (version preference) + UV_PYTHON_PREFERENCE=only-system (block downloads) elegantly eliminates both edge cases without conditional logic.
|
Closing — tested locally and
The screenshot was from before #203 was merged. No additional fix needed. This comment was posted by an AI assistant (OpenHands) on behalf of a user. |
Problem
PR #203 replaced
UV_PYTHON_PREFERENCE=only-systemwithUV_PYTHON=3.12. This fixed repos with newer Python (e.g..python-version: 3.13) but re-broke repos with older Python (e.g..python-version: 3.11) —UV_PYTHONalone doesn't preventuvfrom downloading the version specified in.python-version.Evidence: MizzenAI/Personality (which has
.python-version: 3.11) started failing again after #203:Fix
Use both env vars:
UV_PYTHON=3.12— tellsuvwhich version to request (fixes .python-version > 3.12)UV_PYTHON_PREFERENCE=only-system— blocks managed downloads (fixes .python-version < 3.12)Together they handle
.python-versionin either direction.This PR was created by an AI assistant (OpenHands) on behalf of a user.