Skip to content

fix(uv): stop exclude-dependencies from stripping packages server venvs need - #1835

Merged
agronskiy merged 1 commit into
plaszkiewicz/fep-1134-scicode-scipy-fix-signedfrom
agronskiy/fix/uv-prohibits-transitive-installs
Jun 30, 2026
Merged

agronskiy merged 1 commit into
plaszkiewicz/fep-1134-scicode-scipy-fix-signedfrom
agronskiy/fix/uv-prohibits-transitive-installs

Conversation

@agronskiy

@agronskiy agronskiy commented Jun 30, 2026 •

Copy link
Copy Markdown
Contributor

Stacked on #1832 (which drops scipy from the same list). Base branch is #1832's; it will retarget to main once #1832 merges.

Summary

[tool.uv].exclude-dependencies in the repo-root pyproject.toml — added to slim full mlflow's heavy transitive deps out of the main env (#727) — also leaks into every per-server venv and silently strips packages those servers explicitly depend on. The first visible casualty: GDPVal stirrup_agent crashes at startup with ModuleNotFoundError: No module named 'PIL', failing 100% of rollouts. The leak is broad — ~12 servers are affected.

Packages dropped from exclude-dependencies

Full set removed (this PR + base #1832):

Package Removed by Needed by (examples)
pillow this PR stirrup_agent, aviary, ether0, grl_sokoban, reasoning_gym, vlm_eval_kit (+ moviepy/weasyprint/torchvision/imageio)
matplotlib this PR ether0, reasoning_gym, scicode, vlm_eval_kit (+ seaborn)
scipy #1832 arena_judge, ether0, grl_sokoban, longmt_eval, math_with_code, newton_bench, scicode, wmt_translation (+ sklearn/scikit-image)
scikit-learn this PR arena_judge, ether0, vlm_eval_kit
joblib this PR arena_judge, longmt_eval (+ sklearn, nltk)
threadpoolctl this PR arena_judge, ether0 (+ sklearn)
contourpy this PR ether0 (+ matplotlib)
cycler this PR ether0, reasoning_gym (+ matplotlib)
kiwisolver this PR ether0, reasoning_gym (+ matplotlib)
cffi this PR weasyprint (via stirrup_agent)

Remaining excludes are genuine mlflow-UI/server deps no environment needs: alembic, blinker, cryptography, flask, flask-cors, graphene, graphql-core, graphql-relay, gunicorn, huey, prettytable, skops, sqlalchemy, wcwidth, werkzeug, waitress.

Plus: responses_api_agents/stirrup_agent/requirements.txt relaxes Pillow==12.2.0 → >=10.4.0,<12, because moviepy caps pillow<12 so the repo-wide 12.2.0 floor can't apply there (resolves to 11.3.0).

Root cause

Every responses_api_agents/* and resources_servers/* requirements file installs nemo-gym editably (-e nemo-gym[dev] @ ../../). When gym env start runs uv pip install -r requirements.txt from a server directory, uv walks up, discovers the repo-root [tool.uv], and applies exclude-dependencies to that server's whole resolution — not just the main env.

The regression trigger is a silent uv version bump (Dockerfile installs uv via curl astral.sh/uv/install.sh, always latest):

Image uv exclude-dependencies behavior stirrup venv
…b44e814f (Apr) 0.11.8 excludes transitive only → direct Pillow pin honored pillow 12.2.0 ✅
…aad609d5 (Jun) 0.11.24 excludes direct requirements too pillow dropped ❌

Under uv ≥0.11.24 the install succeeds with exit 0 and just omits the excluded packages — no conflict, no warning. The requirements.txt pin is powerless.

Evidence (verified in the aad609d5 image)

  • …/stirrup_agent/.venv → import PIL → ModuleNotFoundError; venv has 396 pkgs incl. moviepy 2.2.1 + stirrup 0.1.11 but no pillow.
  • Running the exact gym install command in-image: uv pip install -r requirements.txt → exit 0, pillow absent. Every pillow spec → dropped.
  • reasoning_gym dry-run: resolves 150 pkgs, numpy/pandas present, but directly-requested matplotlib/pillow/cycler/kiwisolver dropped.

Affected sub-venvs

Build their venv from the repo checkout (deployment/CI image and any dev running gym env start from a clone with uv ≥0.11.x). Pure wheel installs are unaffected ([tool.uv] isn't in wheel metadata).

Direct (server's own requirements lists an excluded package)

Sub-venv Dropped (direct)
responses_api_agents/stirrup_agent pillow
resources_servers/arena_judge scipy, joblib, threadpoolctl, scikit-learn
resources_servers/aviary pillow
resources_servers/ether0 matplotlib, pillow, contourpy, cycler, kiwisolver, scikit-learn, scipy, joblib, threadpoolctl
resources_servers/grl_sokoban scipy, pillow
resources_servers/longmt_eval scipy, joblib
resources_servers/math_with_code scipy
resources_servers/newton_bench scipy
resources_servers/reasoning_gym matplotlib, pillow, cycler, kiwisolver
resources_servers/scicode scipy, matplotlib
resources_servers/vlm_eval_kit matplotlib, pillow, scikit-learn
resources_servers/wmt_translation scipy

Transitive (server requests a puller of an excluded dep)

Sub-venv Puller → dropped dep
responses_api_agents/stirrup_agent seaborn→matplotlib+scipy, weasyprint→pillow+cffi, reportlab→pillow
resources_servers/grl_sokoban imageio→pillow
resources_servers/longmt_eval torchvision→pillow
resources_servers/wmt_translation torchvision→pillow
resources_servers/vlm_eval_kit torchvision→pillow, scikit-image→scipy+pillow+imageio, imageio→pillow, nltk→joblib
resources_servers/cvdp nltk→joblib
resources_servers/ifbench nltk→joblib

Validation (in aad609d5 image, with this exact edit applied)

stirrup_agent, reasoning_gym, arena_judge all resolve exit 0; full stirrup install → import PIL, moviepy, stirrup, seaborn, matplotlib, weasyprint all succeed (PIL 11.3.0). Servers pinning pillow==12.2.0 (e.g. reasoning_gym) still resolve to 12.2.0 — their libs don't cap pillow.

Tradeoff / follow-up

  • stirrup_agent gets pillow 11.3.0 (not the fix(security): upgrade dependencies for CVE remediation #1370 12.2.0 CVE floor) because moviepy caps <12. If a pillow CVE needs ≥12, stirrup needs a moviepy bump that lifts the cap.
  • Un-excluding these re-admits full mlflow's heavy transitive deps into the main env, growing the image. The cleaner long-term fix is to drop the full mlflow dep and keep only mlflow-skinny (which doesn't pull these) — but the code currently imports non-skinny mlflow, so that needs its own investigation.

🤖 Generated with Claude Code

@agronskiy
agronskiy requested a review from a team as a code owner June 30, 2026 14:26
@agronskiy
agronskiy force-pushed the agronskiy/fix/uv-prohibits-transitive-installs branch 2 times, most recently from bfed1d3 to f8dd9ec Compare June 30, 2026 14:49
@agronskiy
agronskiy changed the base branch from main to plaszkiewicz/fep-1134-scicode-scipy-fix-signed June 30, 2026 14:49
Remove pillow, matplotlib, scikit-learn, joblib, threadpoolctl, contourpy,
cycler, kiwisolver, and cffi from [tool.uv].exclude-dependencies (scipy is
dropped by the base PR #1832).

Every responses_api_agents/* and resources_servers/* venv installs nemo-gym
editably and inherits this [tool.uv] config, so under uv >=0.11.24 these
packages were silently dropped (exit 0, no error) from server venvs that
depend on them -- e.g. GDPVal stirrup_agent crashed at startup on
`from PIL import Image`. Full root-cause analysis and affected-server list in
the PR description.

stirrup_agent: relax Pillow==12.2.0 -> >=10.4.0,<12 since moviepy caps
pillow<12 (the repo-wide 12.2.0 floor can't apply there).

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
Signed-off-by: Alex Gronskiy <[email protected]>
@agronskiy
agronskiy force-pushed the agronskiy/fix/uv-prohibits-transitive-installs branch from f8dd9ec to f0b78a6 Compare June 30, 2026 14:53
@agronskiy
agronskiy merged commit eb57a04 into plaszkiewicz/fep-1134-scicode-scipy-fix-signed Jun 30, 2026
15 checks passed
@agronskiy
agronskiy deleted the agronskiy/fix/uv-prohibits-transitive-installs branch June 30, 2026 14:55
agronskiy added a commit that referenced this pull request Jun 30, 2026
…vs need (#1835)

## Summary

`[tool.uv].exclude-dependencies` in the repo-root `pyproject.toml` -
added to slim full `mlflow`'s heavy transitive deps out of the **main**
env (#727) - also leaks into **every per-server venv** and silently
strips packages those servers explicitly depend on. Approx 12 servers
affected

This PR removes the packages that servers genuinely need from
`exclude-dependencies` and forces the `pillow==12.2.0` CVE floor via
`override-dependencies`.

## Root cause

Every `responses_api_agents/*` and `resources_servers/*` requirements
file installs nemo-gym editably (`-e nemo-gym[dev] @ ../../`). When `gym
env start` runs `uv pip install -r requirements.txt` from a server
directory, uv walks up, discovers the repo-root `[tool.uv]`, and applies
`exclude-dependencies` to **that server's whole resolution** — not just
the main env.

After uv version bump: the Dockerfile installs uv via `curl
astral.sh/uv/install.sh` (always latest):

| Image | uv | `exclude-dependencies` behavior | stirrup venv |
|---|---|---|---|
| `…b44e814f` (Apr) | 0.11.8 | excludes **transitive** only → direct
`Pillow` pin honored | pillow 12.2.0 ✅ |
| `…aad609d5` (Jun) | 0.11.24 | excludes **direct requirements too** |
pillow **dropped** ❌ |

Under uv ≥0.11.24 the install succeeds with exit 0 and just omits the
excluded packages.

## Affected sub-venvs

These build their venv from the repo checkout (deployment/CI image
**and** any dev running `gym env start` from a clone with uv ≥0.11.x).
Pure wheel installs are unaffected (`[tool.uv]` isn't in wheel
metadata).

### Direct (server's own requirements lists an excluded package)

| Sub-venv | Dropped (direct) |
|---|---|
| `responses_api_agents/stirrup_agent` | **pillow** |
| `resources_servers/arena_judge` | scipy, joblib, threadpoolctl,
scikit-learn |
| `resources_servers/aviary` | pillow |
| `resources_servers/ether0` | matplotlib, pillow, contourpy, cycler,
kiwisolver, scikit-learn, scipy, joblib, threadpoolctl |
| `resources_servers/grl_sokoban` | scipy, pillow |
| `resources_servers/longmt_eval` | scipy, joblib |
| `resources_servers/math_with_code` | scipy |
| `resources_servers/newton_bench` | scipy |
| `resources_servers/reasoning_gym` | matplotlib, pillow, cycler,
kiwisolver |
| `resources_servers/scicode` | scipy, matplotlib |
| `resources_servers/vlm_eval_kit` | matplotlib, pillow, scikit-learn |
| `resources_servers/wmt_translation` | scipy |

### Transitive (server requests a puller of an excluded dep)

| Sub-venv | Puller → dropped dep |
|---|---|
| `responses_api_agents/stirrup_agent` | seaborn→matplotlib+scipy,
weasyprint→pillow+cffi, reportlab→pillow |
| `resources_servers/grl_sokoban` | imageio→pillow |
| `resources_servers/longmt_eval` | torchvision→pillow |
| `resources_servers/wmt_translation` | torchvision→pillow |
| `resources_servers/vlm_eval_kit` | torchvision→pillow,
scikit-image→scipy+pillow+imageio, imageio→pillow, nltk→joblib |
| `resources_servers/cvdp` | nltk→joblib |
| `resources_servers/ifbench` | nltk→joblib |

(Only `stirrup_agent` is baked into the current GDPVal/nemotron image;
the rest fail wherever their own benchmark configs run.)

## The fix

`pyproject.toml`:

1. **Drop from `exclude-dependencies`** the packages servers depend on
(directly or hard-transitively): `cffi, contourpy, cycler, joblib,
kiwisolver, matplotlib, pillow, scikit-learn, scipy, threadpoolctl`. The
remaining entries are genuine mlflow-UI/server deps (flask, alembic,
sqlalchemy, graphene, …) no environment needs.
2. **Add `override-dependencies = ["pillow==12.2.0"]`** — keeps #1370's
CVE floor while overriding moviepy's conservative `<12` cap (12.2.0
works at runtime, as the older uv-0.11.8 image proves).

A short breadcrumb comment in the file points back to this PR so the
exclude list isn't re-broken later.

### Validation (in `aad609d5` image, with this exact edit applied)

`stirrup_agent`, `reasoning_gym`, `arena_judge` all resolve **exit 0**
with `pillow==12.2.0`, `matplotlib`, `scipy`, `scikit-learn`, `joblib`
present; full stirrup install → `import PIL, moviepy, stirrup, seaborn,
matplotlib, weasyprint` all succeed.

Signed-off-by: Alex Gronskiy <[email protected]>
Co-authored-by: Claude Opus 4.8 (1M context) <[email protected]>
Signed-off-by: Alex Gronskiy <[email protected]>
sephmard added a commit that referenced this pull request Jul 1, 2026
Removes contourpy, cycler, joblib, kiwisolver, matplotlib, narwhals,
pillow, scikit-learn, scipy, and threadpoolctl from exclude-dependencies.
These were added by mistake — PR #1835 deliberately removed them because
server venvs (arena_judge, ether0, scicode, reasoning_gym, etc.) depend
on them. Re-adding them broke CI with ModuleNotFoundError in arena_judge
and ether0 (missing narwhals).

Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
Signed-off-by: Seph Mard <[email protected]>
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.

1 participant