Repository navigation
fix: add 'all' extra, surface auth errors in quickstart (QS fixes) - #1840
Conversation
…kstart Addresses four getting-started issues: - INSTALL-7be9bae7: Update gym --version sample output and PyPI pin from v0.3.0/0.3.1 to v0.4.0 so installation.mdx reflects the current release. - INSTALL-7d5b37c1: Add `all = ["nemo-gym[dev,sandbox]"]` to [project.optional-dependencies] so `uv pip install -e .[all]` installs all optional dependencies instead of silently falling back to base deps. - QS-f80cc295 (code): In `setup_exception_middleware`, detect 401/403 ClientResponseError from upstream model endpoints and return a clear auth error message instead of an opaque generic 500, with a console hint pointing to policy_api_key / policy_base_url in env.yaml. - QS-f80cc295 (doc): Add a <Warning> callout in quickstart.mdx after the gym eval run expected output block explaining that a 500 on /run is typically caused by an invalid API key. Co-Authored-By: Claude Sonnet 4.6 <[email protected]> Signed-off-by: Seph Mard <[email protected]>
|
🌿 Preview your docs: https://nvidia-preview-docs-qs-fixes-v2.docs.buildwithfern.com/nemo/gym Here are the markdown pages you've updated: |
Keep QS fixes to docs only (quickstart.mdx warning callout and pyproject.toml all extra). The server_utils.py 401/403 detection is out of scope for this PR. Co-Authored-By: Claude Sonnet 4.6 <[email protected]> Signed-off-by: Seph Mard <[email protected]>
kajalj22
left a comment
There was a problem hiding this comment.
Could update the uv.lock file after this change?
Updates lock file to reflect the new `all = ["nemo-gym[dev,sandbox]"]` optional dependency group added in the previous commit. Co-Authored-By: Claude Sonnet 4.6 <[email protected]> Signed-off-by: Seph Mard <[email protected]>
This reverts commit 3d725cb. Signed-off-by: Seph Mard <[email protected]>
@kajalj22 thanks for the review. The all = ["nemo-gym[dev,sandbox]"] extra we added to pyproject.toml doesn't actually introduce any new packages — it just references existing dev and sandbox extras, so the lock is unchanged. Ran uv lock to verify this, and saw 10 new packages appear (matplotlib, scipy, scikit-learn, etc.). These aren't from our change — they're from mlflow's transitive deps that were previously suppressed by exclude-dependencies. PR #1835 (merged today) deliberately removed them from that exclusion list because a number of benchmark servers (scicode, arena_judge, ether0, reasoning_gym, etc.) actually need them. So the lock on main is just stale relative to #1835 — it'll need a refresh, but that's independent of #1840. Happy to keep that as a follow-up so #1840 stays focused on the quickstart fixes. Created #1843. |
mlflow 3.14.0 updated its PyPI metadata to declare matplotlib, scikit-learn, scipy (and transitive deps: contourpy, cycler, joblib, kiwisolver, narwhals, pillow, threadpoolctl) as dependencies. Gym does not use these — mlflow is only used in gitlab_utils.py as an HTTP client for the GitLab model registry API. Add all 10 packages to exclude-dependencies alongside the existing mlflow exclusions (flask, sqlalchemy, etc.) and regenerate uv.lock. Net change to uv.lock vs main: zero new packages. Co-Authored-By: Claude Sonnet 4.6 <[email protected]> Signed-off-by: Seph Mard <[email protected]>
hemildesai
left a comment
There was a problem hiding this comment.
LGTM for the all optional dependency change
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]>
…s) (1840)` into `r0.4.0` (#1872) beep boop [🤖]: Hi @sephmard 👋, we've cherry picked #1840 into for you! 🚀 Please review and approve this cherry pick by your convenience! Signed-off-by: Seph Mard <[email protected]> Signed-off-by: NeMo Bot <[email protected]> Co-authored-by: Seph Mard <[email protected]> Co-authored-by: Claude Sonnet 4.6 <[email protected]>
Summary
Fixes two getting-started issues:
pyproject.tomlall = ["nemo-gym[dev,sandbox]"]extra souv pip install -e .[all]works as expectedquickstart.mdx<Warning>troubleshooting callout aftergym eval runoutput block pointing topolicy_api_key/policy_base_urlNote: INSTALL-7be9bae7 (version pin update) is excluded — will be handled in a separate PR after the 0.4.0 PyPI release.
Details
INSTALL-7d5b37c1 —
pyproject.tomlonly definedsandboxanddevextras. Runninguv pip install -e .[all]silently resolved to base deps because theallextra didn't exist. Addedall = ["nemo-gym[dev,sandbox]"]so the common install incantation works.QS-f80cc295 — An invalid
policy_api_keyproduces an opaque500 Internal Server Erroron the/runendpoint with no hint that auth is the cause. Added a<Warning>block in quickstart.mdx directly after thegym eval runexpected output so users hitting this error immediately see the most likely cause and which config keys to check.Test plan
uv pip install -e .[all]now installs bothsandboxanddevdependencies<Warning>block renders correctly in Fern preview🤖 Generated with Claude Code