nemo_gym.orchestration.server_venv
nemo_gym.orchestration.server_venv
Module Contents
Functions
Data
NEMO_GYM_ALLOWED_COMPONENT_ROOTS_ENV_VAR_NAME
_LOCAL_NEMO_GYM_REQUIREMENT_RE
API
Build uv pip install flags for nemo-gym in sub-venvs.
Supports:
- Pre-release versions via NEMO_GYM_ALLOW_PRERELEASE=true
- Custom PyPI indexes via UV_INDEX_URL, UV_EXTRA_INDEX_URL, UV_INDEX_STRATEGY
- Auto-detection of parent venv version for consistency
Returns: str
String of flags to add to ‘uv pip install nemo-gym’
Detect nemo-gym version from parent venv and return version specifier.
Parameters:
Whether nemo-gym is installed in editable mode in parent venv
Returns: str
Version specifier string (e.g., “==0.2.1rc0”) or empty string
The extras a server requests on its local Gym requirement, formatted as [a,b], or "" for none.
Installs from PyPI replace the server’s nemo-gym[...] @ ../../ line with a nemo-gym requirement, so
its extras must be carried over or their dependencies are never installed.
Whether a uv Python request admits version.
The request is a specifier such as >=3.13,<3.14 or a version such as 3.13, optionally prefixed with
cpython@ or cpython. Requests this cannot interpret, such as pypy@3.10 or the free-threaded
3.13+freethreaded, admit nothing and are left to uv.
The interpreter a server venv is built with: the parent’s, unless the server’s .python-version excludes it.
A range such as >=3.13.14,<3.14 would otherwise let uv pick a different patch release than the parent’s,
and Ray refuses to connect processes whose Python patch versions differ.
Reject a server resolved outside scheduler-approved component roots.
Resolve the venv a server runs from: uv_venv_dir/<type>/<name>/.venv, else <server dir>/.venv.
Callers need this to launch a server with the venv’s own interpreter rather than trusting whatever
bin/activate puts on PATH. A venv copied or moved after creation keeps the original prefix
hard-coded in bin/activate, so sourcing it silently hands the server a different interpreter than
the one uv_venv_dir asked for.
Prepare a component from its lock, or retain custom component setup.