fix(install): pass an explicit Python version request to uv tool install - #34750
Conversation
uv selects an interpreter before resolving dependencies, so with no --python request the stock macOS /usr/bin/python3 (3.9.6) satisfies the unconstrained request and resolution then fails against litellm's requires-python (>=3.10,<3.15) instead of downloading a managed Python. Request the requires-python range explicitly in install-cli.sh and install.sh so uv reuses a compatible system interpreter when present and downloads a managed one otherwise. The manual-fallback hint in the die message carries the same flag so it no longer reproduces the failure.
Greptile SummaryThis PR aligns both shell installers with LiteLLM’s supported Python range.
Confidence Score: 5/5The PR appears safe to merge, with both installer paths consistently requesting a supported Python interpreter. The pinned uv version supports ranged Python requests, the new range matches the project’s current Python requirement, and system-preferred selection can fall back to a managed interpreter when necessary.
|
| Filename | Overview |
|---|---|
| scripts/install-cli.sh | Adds a valid Python range matching project metadata to CLI installation and fallback commands; no actionable issue found. |
| scripts/install.sh | Applies the same compatible interpreter selection fix to the proxy installer; no actionable issue found. |
Reviews (1): Last reviewed commit: "fix(install): pass an explicit Python ve..." | Re-trigger Greptile
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
|
bugbot run |
There was a problem hiding this comment.
✅ Bugbot reviewed your changes and found no new issues!
Comment @cursor review or bugbot run to trigger another review on this PR
Reviewed by Cursor Bugbot for commit b089992. Configure here.
TLDR
Problem this solves:
How it solves it:
Relevant issues
uv tool installpicks an interpreter before resolving, so with no--pythonrequest stock macOS Python 3.9.6 satisfies the unconstrained request and resolution then fails against litellm'srequires-python = ">=3.10, <3.15"instead of downloading a managed Pythonscripts/install-cli.shandscripts/install.sh; both are fixed identicallyLinear ticket
Pre-Submission checklist
Please complete all items before asking a LiteLLM maintainer to review your PR
@greptileaito re-request a review after pushing changes)Screenshots / Proof of Fix
All runs simulate a stock Mac: fresh
HOME,PATH=/usr/bin:/bin:/usr/sbin:/sbinso the only interpreter uv can discover is/usr/bin/python3(3.9.6), andLITELLM_CLI_REF=litellm_internal_stagingBefore, at commit 2412326 (staging head, unfixed):
scripts/install.shfails identically withlitellm[proxy]After, at commit b089992 (fixed), same environment:
System Python reuse still works at b089992 (same run with
/opt/homebrew/binprepended toPATH): no cpython download happens,~/.local/share/uv/pythonis never created, and the tool venv'spyvenv.cfgshowshome = /opt/homebrew/opt/python@3.14/binwithversion_info = 3.14.5scripts/install.shin the stock environment at b089992 downloads cpython-3.14.3 the same way and reaches✔ LiteLLM installedwithInstalled 3 executables: lite, litellm, litellm-proxy(that run then stops at the script's pre-existing interactive--setupprompt, which needs a real terminal and is unrelated to this change)Type
🐛 Bug Fix
Changes
--python '>=3.10,<3.15'to theuv tool installinvocation inscripts/install-cli.shandscripts/install.shdiemessage, which previously suggested a command that reproduced the failurerequires-pythonon its own; uv selects the interpreter before resolving, so it does notThe range duplicates
requires-pythonfrompyproject.tomlbecause a curl-to-sh bootstrap has nothing on disk to read it from; the comment marks it keep-in-sync. Without the explicit request, the default PyPI path fails worse than the git path: uv quietly resolves the newest release whose metadata admits Python 3.9, which today installs litellm 1.83.9 instead of 1.93.0There is no test harness for
scripts/*.shand CI does not execute these scripts, so the proof above is live installer runs rather than unit testsFinal Attestation
Note
Low Risk
Changes are limited to bootstrap shell installers and error-message hints; no proxy, auth, or application runtime code is touched.
Overview
Fixes curl-to-sh installs on hosts where the only discoverable Python is too old (e.g. stock macOS 3.9) by passing
--python '>=3.10,<3.15'touv tool installinscripts/install-cli.shandscripts/install.sh, matchingrequires-pythoninpyproject.toml.Without that flag, uv picks an interpreter before dependency resolution, so 3.9 can be selected and install fails—or on the default PyPI path, an older litellm that still allows 3.9 can be installed.
--python-preference systemis unchanged, so a compatible system Python is still reused when available.Comments are updated to document the behavior, and the manual retry text in each
diemessage includes the same--pythonflag.Reviewed by Cursor Bugbot for commit b089992. Bugbot is set up for automated code reviews on this repo. Configure here.