Skip to content

ci(windows): pin uv to Python 3.11 so it ignores the preinstalled 3.14#30704

Merged
mateo-berri merged 1 commit into
litellm_internal_stagingfrom
litellm_fix_windows_python_pin
Jun 18, 2026
Merged

ci(windows): pin uv to Python 3.11 so it ignores the preinstalled 3.14#30704
mateo-berri merged 1 commit into
litellm_internal_stagingfrom
litellm_fix_windows_python_pin

Conversation

@mateo-berri

@mateo-berri mateo-berri commented Jun 18, 2026

Copy link
Copy Markdown
Collaborator

Relevant issues

The using_litellm_on_windows job fails intermittently on the dependency install:

Using CPython 3.14.5 interpreter at: C:\Python314\python.exe
error: The requested interpreter resolved to Python 3.14.5, which is
incompatible with the project's Python requirement: `>=3.10, <3.14`

The job installs Python 3.11.0 via choco, then picks the interpreter for uv with (Get-Command python).Source. The win/default image ships Python 3.14.5 preinstalled at C:\Python314, and the dependency-install step runs in a fresh shell where the machine PATH ordering between the preinstalled 3.14 and the choco-installed 3.11 is not guaranteed. When Get-Command python lands on 3.14, uv aborts because the project requires >=3.10, <3.14.

This is luck-of-the-draw, not a code change: the same config passes on adjacent commits and on staging when PATH happens to surface C:\Python311 first. Recent evidence is a staging run that resolved C:\Python311\python.exe and passed minutes before a branch run that resolved C:\Python314\python.exe and failed, both on identical config.

Linear ticket

N/A

Pre-Submission checklist

  • I have added meaningful tests
  • My PR passes all unit tests on make test-unit
  • My PR's scope is as isolated as possible; it only solves 1 specific problem
  • I have requested a Greptile review by commenting @greptileai and received a Confidence Score of at least 4/5 before requesting a maintainer review

Note on tests: this is a CI-config-only change; the regression coverage is the Windows job itself, which now selects the interpreter by version request instead of by PATH order

Screenshots / Proof of Fix

The fix stops trusting PATH order and tells uv to select Python by version, so it resolves the 3.11 interpreter and ignores the preinstalled 3.14 regardless of ordering. UV_PYTHON: "3.11" is set at the job level so every uv invocation (sync, plus the uv venv and uv build in the wheel-guard step, which carries the same latent flake) targets 3.11.

Before: the failing run resolved C:\Python314\python.exe and aborted at dependency install with the error above.

After: this branch's using_litellm_on_windows run resolves C:\Python311\python.exe and goes green:

Using CPython 3.11.0 interpreter at: C:\Python311\python.exe
Installed 143 packages in 6.06s

Run: https://app.circleci.com/pipelines/github/BerriAI/litellm/82399/workflows/6dbb878b-9706-4468-9cba-694f10459f3c/jobs/1850713

Type

🚄 Infrastructure
🐛 Bug Fix

Changes

In using_litellm_on_windows, set UV_PYTHON: "3.11" at the job level and change the sync from --python (Get-Command python).Source to --python 3.11. uv treats --python 3.11 as a version request and selects the choco-installed 3.11 interpreter, so the image's preinstalled 3.14 no longer wins on PATH

@codecov

codecov Bot commented Jun 18, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@mateo-berri mateo-berri marked this pull request as ready for review June 18, 2026 01:00
@mateo-berri mateo-berri requested a review from a team June 18, 2026 01:00
@mateo-berri mateo-berri requested a review from a team June 18, 2026 01:01
@greptile-apps

greptile-apps Bot commented Jun 18, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

Fixes intermittent Windows CI failures caused by uv resolving the preinstalled Python 3.14 instead of the choco-installed 3.11, because PATH ordering between the two interpreters is not guaranteed across shells on the win/default image. The project requires >=3.10, <3.14, so a 3.14 interpreter caused uv to abort at dependency install.

  • Sets UV_PYTHON: \"3.11\" at the job level so every uv invocation in using_litellm_on_windows — including uv venv and uv build in the wheel-guard step — targets the correct interpreter without relying on PATH.
  • Replaces --python (Get-Command python).Source (PATH-dependent) with --python 3.11 (version request) in the uv sync step so uv selects the right interpreter by version rather than by whichever python binary comes first.

Confidence Score: 5/5

Safe to merge — the change is scoped entirely to the Windows CI job and tightens interpreter selection from PATH-dependent to version-pinned.

Both changes work together: the job-level env var covers all uv invocations (venv, build, etc.) while the explicit --python 3.11 on the sync step makes the version intent self-documenting. There is no application code touched, and the fix has been verified against an actual passing CI run linked in the PR description.

No files require special attention.

Important Files Changed

Filename Overview
.circleci/config.yml Adds UV_PYTHON: "3.11" job-level env var and replaces the PATH-dependent (Get-Command python).Source with an explicit --python 3.11 version request, preventing the preinstalled Python 3.14 from winning on non-deterministic PATH ordering.

Reviews (1): Last reviewed commit: "ci(windows): pin uv to Python 3.11 so it..." | Re-trigger Greptile

@mateo-berri mateo-berri merged commit 9b1c1e9 into litellm_internal_staging Jun 18, 2026
121 checks passed
@mateo-berri mateo-berri deleted the litellm_fix_windows_python_pin branch June 18, 2026 01:01
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