-
Notifications
You must be signed in to change notification settings - Fork 292
Expand file tree
/
Copy pathpyproject.toml
More file actions
740 lines (651 loc) · 31.1 KB
/
Copy pathpyproject.toml
File metadata and controls
740 lines (651 loc) · 31.1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
# SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
# SPDX-License-Identifier: Apache-2.0
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
################################################
# Project
################################################
[project]
name = "nemo-gym"
dynamic = [
"version",
"readme",
]
description = "NeMo Gym is a library for building reinforcement learning environments"
license = {file = "LICENSE"}
requires-python = ">=3.13.14"
authors = [{ name = "NVIDIA" }]
maintainers = [{ name = "NVIDIA" }]
keywords = [
"reinforcement-learning",
"RL",
"agent",
"agentic",
"LLM",
"large-language-models",
"training-data",
"rollout",
"trajectory",
"verification",
"verifier",
"reward",
"tool-calling",
"function-calling",
"data-collection",
"NeMo",
"NVIDIA",
]
classifiers = [
"Development Status :: 4 - Beta",
"Environment :: Console",
"Intended Audience :: Developers",
"Intended Audience :: Science/Research",
"License :: OSI Approved :: Apache Software License",
"Natural Language :: English",
"Operating System :: OS Independent",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.13",
"Topic :: Scientific/Engineering",
"Topic :: Scientific/Engineering :: Artificial Intelligence",
"Topic :: Scientific/Engineering :: Mathematics",
"Topic :: Software Development :: Libraries",
"Topic :: Software Development :: Libraries :: Python Modules",
]
dependencies = [
########################################
# Every dependency listed here contains the following information:
# 1. Why this dependency is here in NeMo Gym
# 2. When this dependency was last updated
# 3. The license of the dependencies.
#
# If you are adding or removing dependencies, please do your due diligence to update this information. PRs to main that modify dependencies will not be accepted unless this information is provided.
# The licenses of the below dependencies include: Apache 2.0, MIT, and BSD 3-Clause
#
# By design, most (if not all) dependencies are unfrozen here to be easier to consume. The core pieces we need are server infra like FastAPI, etc.
#
# Dependency management philosophy:
# - pyproject.toml: Specifies minimum version requirements (e.g., "mlflow>=3.5.0" means "we need at least 3.5.0 for security/features")
# - uv.lock: Locks exact versions for reproducibility (e.g., "mlflow==3.9.0" means "we're currently using exactly 3.9.0")
# This ensures both flexibility for consumers and reproducibility for developers.
########################################
# OpenAI: We leverage OpenAI Responses, Chat Completions, and Completions schemas for Nemo Gym abstractions. It may also be used to directly query endpoints.
# We specifically upper bound this OpenAI dependency since the version bumps so frequently.
# Pinned to a single version, not a range.
# Gym subclasses the SDK's pydantic models and mirrors its Responses item union by hand.
# Each version needs its own audit, so a range would claim support for versions nobody tested.
# 2.45.0 makes InputTokensDetails.cache_write_tokens required, which NeMoGymResponseInputTokensDetails cannot satisfy.
# Moving this pin means re-running tests/unit_tests/test_openai_utils.py, which names each item type Gym cannot represent.
# Updated Tue Aug 11, 2026 with openai==2.44.0
# License: Apache 2.0 https://github.com/openai/openai-python/blob/v2.44.0/LICENSE
"openai==2.44.0",
# Anthropic: We leverage the Anthropic Messages schemas (request/response Python types) for the
# /v1/messages <-> Responses mapping in nemo_gym/anthropic_converter.py. Types only — we never
# use the anthropic client (it uses httpx, whose O(n^2) connection pooling hangs at high
# concurrency); all transport stays on aiohttp. Upper-bounded since the version bumps frequently,
# mirroring how we pin openai.
# Updated Tue Jun 16, 2026 with anthropic<=0.109.2
# License: MIT https://github.com/anthropics/anthropic-sdk-python/blob/v0.109.2/LICENSE
"anthropic<=0.109.2",
# tqdm: Used for progress tracking on batch operations.
# Updated Fri Jul 25, 2025 with tqdm==4.67.1
# License: MIT https://github.com/tqdm/tqdm/blob/0ed5d7f18fa3153834cbac0aa57e8092b217cc16/LICENCE
"tqdm",
# Pydantic: Used for typing and import/export.
# Updated Fri Jul 25, 2025 with pydantic==2.11.7 and pydantic_core==2.33.2
# pydantic license: MIT https://github.com/pydantic/pydantic/blob/1c79f0e4d3fbdb8b93e837175d7098e016117237/LICENSE
# pydantic_core license: MIT https://github.com/pydantic/pydantic-core/blob/17cbe988de187701dd21d5cd2306086ced5a8872/LICENSE
# devtools license: MIT https://github.com/samuelcolvin/python-devtools/blob/5022f1f6f1c55d871b1db208c9c1b2ab0df488fe/LICENSE
"pydantic",
"pydantic_core",
"devtools",
# Packaging: Validates SPDX license expressions in environment manifests.
# Updated Tue Aug 11, 2026 with packaging==25.0
# License: Apache-2.0 OR BSD-2-Clause https://github.com/pypa/packaging/tree/25.0
"packaging>=24.2",
# FastAPI: Used for server infrastructure
# Updated Thu Mar 26, 2026 with fastapi==0.135.2
# License: MIT https://github.com/fastapi/fastapi/blob/25a3697cedc6e7dfb84e93c8ff965801486f00f4/LICENSE
"fastapi",
# MCP Python SDK: Used by Gym-owned Streamable HTTP MCP resources servers.
# Updated Tue Jul 29, 2026 with mcp>=1.28.1,<2
# License: MIT https://github.com/modelcontextprotocol/python-sdk/blob/main/LICENSE
"mcp>=1.28.1,<2",
# itsdangerous: Requirement for Starlette SessionMiddleware
# Updated Tue Feb 17, 2026 with itsdangerous==2.2.0
# License: BSD 3-Clause https://github.com/pallets/itsdangerous/blob/672971d66a2ef9f85151e53283113f33d642dabd/LICENSE.txt
"itsdangerous",
# Uvicorn: Used to serve FastAPI apps
# Updated Mon Jul 28, 2025 with uvicorn==0.35.0
# License: BSD 3-Clause https://github.com/encode/uvicorn/blob/c1144fd4f130388cffc05ee17b08747ce8c1be11/LICENSE.md
"uvicorn",
# UVLoop: a faster async event loop than Python's native asyncio. Used automatically by Uvicorn as an async loop backend.
# Updated Fri Aug 01, 2025 with uvloop==0.21.0
# License: Apache 2.0 and MIT https://github.com/MagicStack/uvloop/blob/96b7ed31afaf02800d779a395591da6a2c8c50e1/LICENSE-APACHE https://github.com/MagicStack/uvloop/blob/96b7ed31afaf02800d779a395591da6a2c8c50e1/LICENSE-MIT
"uvloop",
# Hydra and OmegaConf: CLI Configuration utilities
# Updated Tue Jul 29, 2025 with hydra-core==1.3.2 and omegaconf==2.3.0
# hydra-core license: MIT https://github.com/facebookresearch/hydra/blob/737fc3349ef3a4031035645f7e8c80be66a57042/LICENSE
# omegaconf license: BSD 3-Clause https://github.com/omry/omegaconf/blob/117f7de07285e4d1324b9229eaf873de15279457/LICENSE
"hydra-core",
"omegaconf",
# rich: used for nicer terminal content displays
# Updated Tue Feb 17, 2026 with rich==14.3.2
# License: MIT https://github.com/Textualize/rich/blob/27701029082052c6541031b6f139097230253900/LICENSE
"rich",
# mlflow-skinny: used for interacting with the Gitlab model registry. We use the "skinny" version that does not have unnecessary dependencies.
# mlflow dependency is necessary for importing. However, all of mlflow's dependencies that don't overlap with mlflow-skinny are excluded below.
# Updated Mon Aug 04, 2026 with mlflow>=3.15.1 (security bump)
# License: Apache 2.0 https://github.com/mlflow/mlflow/blob/c6ce84e817897e1a0461632f8a06d4e5e4ac3726/LICENSE.txt
"mlflow-skinny>=3.15.1",
"mlflow>=3.15.1",
# aiohttp: async http backend
# Updated Sun Jun 29, 2026 with aiohttp>=3.14.1 (CVE mitigation)
# License: Apache 2.0 https://github.com/aio-libs/aiohttp/blob/9a2f146a12e3525b43e96723ef41584bf9cf784e/LICENSE.txt
"aiohttp>=3.14.1",
# yappi: profiling tool
# Updated Wed Aug 12, 2026 with yappi==1.7.6 for CPython 3.14 support
# License: MIT https://github.com/sumerc/yappi/blob/1d3f7501701e1f050b6dcd6a86fd36aec08185c7/LICENSE
"yappi>=1.7.6",
# Ray: Used for distributed processing
# Updated Tue Jul 29, 2026 with ray[default]>=2.56.1
# License: Apache 2.0 https://github.com/ray-project/ray/blob/master/LICENSE
"ray[default]>=2.56.1",
# psutil: Cross-platform process and system utilities
# Updated: Fri Nov 07, 2025 with psutil==6.1.1
# License: BSD 3-Clause https://github.com/giampaolo/psutil/blob/master/LICENSE
"psutil",
# HuggingFace datasets: for loading and converting parquet datasets
# Updated Thu Dec 04, 2025 with datasets==4.4.1
# License: Apache 2.0 https://github.com/huggingface/datasets/blob/main/LICENSE
"datasets",
# orjson: JSON library for faster serialization/deserialization
# Updated: Thu Jan 08, 2026 with orjson==3.11.3
# License: Apache 2.0 https://github.com/ijl/orjson/blob/fb3eb1f729c7e7b019f780af5695722c99c7c695/LICENSE-APACHE
"orjson",
# urllib3: HTTP client library (transitive dependency, pinned for security)
# Updated: Mon May 19, 2026 with urllib3>=2.7.0
# License: MIT https://github.com/urllib3/urllib3/blob/main/LICENSE.txt
"urllib3>=2.7.0",
# fonttools: Library to manipulate font files (transitive dependency, pinned for security)
# Updated: Mon Feb 10, 2026 with fonttools>=4.60.2
# License: MIT https://github.com/fonttools/fonttools/blob/main/LICENSE
"fonttools>=4.60.2",
# python-multipart: Streaming multipart parser (transitive dependency, pinned for security)
# Updated: Mon Feb 10, 2026 with python-multipart>=0.0.22
# License: Apache 2.0 https://github.com/andrew-d/python-multipart/blob/master/LICENSE.txt
"python-multipart>=0.0.22",
# pyarrow: columnar data library (transitive dependency via mlflow, pinned for security)
# mlflow caps pyarrow<25; versions >=23.0.1 have cp313 wheels and address use-after-free.
# Updated: Tue Jul 29, 2026 with pyarrow>=23.0.1
# License: Apache 2.0 https://github.com/apache/arrow/blob/main/LICENSE
"pyarrow>=23.0.1",
# wandb: E2E rollout collection data and metrics upload
# Updated: Mon May 19, 2026 with wandb==0.27.0
# License: MIT https://github.com/wandb/wandb/blob/f8acf479342b6aa8217dd0833bb32190b11c14bc/LICENSE
"wandb",
# GitPython: Git interaction library (transitive dependency of wandb, pinned for security)
# Updated: Mon Aug 04, 2026 with GitPython>=3.1.57
# License: BSD 3-Clause https://github.com/gitpython-developers/GitPython/blob/main/LICENSE
"GitPython>=3.1.57",
# pyasn1: ASN.1 library (transitive dependency via google-auth, pinned for security)
# Updated: Tue Jul 29, 2026 with pyasn1>=0.6.4
# License: BSD 2-Clause https://pyasn1.readthedocs.io/en/latest/license.html
"pyasn1>=0.6.4",
# pydot License: MIT https://github.com/pydot/pydot/blob/a2bee1e770698867332516fb2878fac262b4ffc5/LICENSES/MIT.txt
"pydot",
]
[project.optional-dependencies]
all = [
"nemo-gym[dev,sandbox]",
]
vllm = [
# Pin to the same version used by local_vllm_model / genrm_model server venvs.
# Updated: Mon Aug 24, 2026 with vllm==0.25.1
"vllm==0.25.1",
# Pin flashinfer to the exact version vllm 0.25.1 specifies, ensuring pre-compiled
# CUDA kernels are used (avoids JIT compilation on first generation == slow step time).
# flashinfer>=0.2 bundles compiled kernels in the python package directly.
"flashinfer-python==0.6.13",
]
sandbox = [
# Tenacity: Retry helpers used by sandbox providers.
# Updated: Sat May 09, 2026 with tenacity==9.1.4
# License: Apache 2.0 https://github.com/jd/tenacity/blob/master/LICENSE
"tenacity>=9.1.4",
# OpenSandbox SDK: used by the OpenSandbox sandbox provider for create/exec/delete and SDK pool creation.
# Lower bound 0.1.15: first version exposing separate `resource_requests` on Sandbox.create.
# Updated: Thu Jul 30, 2026 with opensandbox>=0.1.15
# License: Apache 2.0
"opensandbox>=0.1.15",
# httpx-aiohttp: aiohttp-backed httpx transport used by the OpenSandbox
# provider's `connection.transport_backend: aiohttp`; without it the
# provider silently falls back to the httpx transport with only a warning.
# Pulls in aiohttp (aiohttp<4,>=3.10).
# Updated: Tue Aug 11, 2026 with httpx-aiohttp>=0.2.0
# License: BSD 3-Clause https://github.com/karpetrosyan/httpx-aiohttp/blob/master/LICENSE
"httpx-aiohttp>=0.2.0",
# Daytona SDK: used by the Daytona sandbox provider for create/exec/delete and file operations.
# License: Apache 2.0 https://pypi.org/project/daytona/
"daytona>=0.179.0",
# boto3: AWS SDK used by the ECS Fargate sandbox provider for ECS/EC2/ECR/
# CodeBuild/S3/SSM/Secrets Manager calls.
# Updated: Tue Jun 03, 2026 with boto3>=1.34
# License: Apache 2.0 https://github.com/boto/boto3/blob/develop/LICENSE
"boto3>=1.34",
]
# Keep OpenShell opt-in so its platform-specific SDK wheel cannot block installs for other providers.
openshell = [
# OpenShell SDK: used by the OpenShell sandbox provider for gateway create/exec/delete over gRPC.
# Lower bound 0.0.92: the version that made `workspace` a required argument on sandbox
# lifecycle calls. Upper bound <0.1: the SDK is alpha 0.0.x and the provider also relies on
# its generated protos (openshell._proto), so minor bumps can break call shapes; the
# SDK-conformance unit test guards the raise of this ceiling.
# Updated: Tue Jul 14, 2026 with openshell>=0.0.92,<0.1
# License: Apache 2.0 https://github.com/NVIDIA/OpenShell/blob/main/LICENSE
"openshell>=0.0.92,<0.1",
]
# Telemetry is opt-in: without this extra (or with `telemetry.enabled: false`) every
# instrumentation site in nemo_gym is a ~0-cost no-op and Gym behaves identically.
#
# NOTE: uv resolves one unified lockfile across all optional-dependency groups, so this
# extra's floor on opentelemetry-api (via nemo-lens[sdk] and the instrumentation packages
# below) raises the version uv.lock records for *every* install, not just one that
# requests `telemetry` — opentelemetry-api was already a transitive dependency (via
# mlflow-tracing, a core dependency) and moved from 1.38.0 to 1.44.0 when this extra was
# added. Accepted: OpenTelemetry's Python API keeps strict backward compatibility within
# 1.x, and the full test suite passes unchanged at 1.44.0. There's no clean uv mechanism
# to isolate one extra's transitive floor from the shared lockfile while still letting it
# be installed alongside other extras (`[tool.uv] conflicts` forces extras to be mutually
# exclusive, which `telemetry` is not — it needs to coexist with `dev`/`sandbox` in CI).
telemetry = [
# nemo-lens: OpenTelemetry instrumentation shared across the NeMo ecosystem. Provides the
# tracer/meter lifecycle, span-group gating, W3C context propagation, and the FastAPI /
# aiohttp auto-instrumentation Gym uses to stitch one trace across its server processes.
# Pinned to a Lens commit via [tool.uv.sources] until 0.2.0 ships to PyPI; then drop that
# entry and use a version range. Megatron-LM pins this same commit.
# Updated: Tue Aug 18, 2026 with nemo-lens @ b85578fc
# License: Apache 2.0 https://github.com/NVIDIA-NeMo/Lens/blob/main/LICENSE
"nemo-lens[sdk]",
# FastAPI + aiohttp OTel auto-instrumentation. Not pulled in by nemo-lens[sdk]: its
# `contrib.instrument_fastapi` / `instrument_aiohttp_client` helpers import these lazily
# and raise ImportError when they are missing. Gym needs both — the FastAPI instrumentor
# extracts inbound traceparent on every server, the aiohttp one is the egress side.
# Updated: Tue Aug 18, 2026 with opentelemetry-instrumentation-*==0.65b0
# License: Apache 2.0 https://github.com/open-telemetry/opentelemetry-python-contrib/blob/main/LICENSE
"opentelemetry-instrumentation-fastapi>=0.60b0",
"opentelemetry-instrumentation-aiohttp-client>=0.60b0",
]
# We include dev dependencies as an extra since technically each server module is a consumer (which means we cannot use dependency groups, which are intended to be within a project).
dev = [
# gprof2dot: Used for outputting dot graphs for profiling.
# Updated: Wed Feb 25, 2026 with gprof2dot==2025.4.14
# License: LGPLv3+ https://github.com/jrfonseca/gprof2dot/blob/master/COPYING.LESSER
"gprof2dot",
# Pre-commit: Used for pre-commit hooks.
# Updated: Thu Sep 04, 2025 with pre-commit==4.3.0
# License: MIT https://github.com/pre-commit/pre-commit/blob/e70b313c8017b2b6d7844e91795c9d41b9ceb9fb/LICENSE
"pre-commit>=3.6.0",
# Mypy: Used for Python type checking.
# Updated: Thu Sep 04, 2025 with mypy==1.17.1
# License: MIT https://github.com/python/mypy/blob/645b421fa23a3f0d63f651059fa1e8318a6f214a/LICENSE
"mypy>=1.8.0",
# Ruff: Used for Python code formatting and linting.
# Updated: Fri Jul 25, 2025 with ruff==0.12.5
# License: MIT https://github.com/astral-sh/ruff/blob/21ac16db85452c2c196d3b9cc61fb27b7b81f3f7/LICENSE
"ruff",
# Coverage: Used for Python code coverage.
# Updated: Fri Jul 25, 2025 with coverage[toml]==7.10.0
# License: Apache 2.0 https://github.com/nedbat/coveragepy/blob/a2baa66b55ca71ea6b35009f2b4a51ff8fda1753/LICENSE.txt
"coverage[toml]",
# Pytest: Used for Python test orchestration.
# Updated: Fri Jul 25, 2025 with pytest-cov==5.0.0, pytest-xdist==3.6.1, pytest==7.4.3, and pytest-asyncio==0.21.1
# pytest-cov license: MIT https://github.com/pytest-dev/pytest-cov/blob/9d6d57c78627d4811fc473610d61a0b7225e4b40/LICENSE
# pytest-xdist license: MIT https://github.com/pytest-dev/pytest-xdist/blob/2f1d80cb9d83ea2d91bba741ef5deffa9f8f85bf/LICENSE
# pytest license: MIT https://github.com/pytest-dev/pytest/blob/5989efe3efec31a9d14f550d89903b6311dfc828/LICENSE
# pytest-asyncio: Apache 2.0 https://github.com/pytest-dev/pytest-asyncio/blob/66b9f8e31f5f3c3bcf124a52f316516e70c90b46/LICENSE
"pytest-cov",
"pytest-xdist",
"pytest",
"pytest-asyncio",
# DefusedXML: Hardened XML parsing for the GitLab JUnit relay receiver.
# License: Python Software Foundation License
"defusedxml>=0.7.1",
# Requests-mock: Used for mocking HTTP requests in tests
# Updated: Fri Jul 25, 2025 and requests-mock==1.12.1
# License: Apache 2.0 https://github.com/jamielennox/requests-mock/blob/9742d02a8cad17276dbeba7b300b6d27ae1b6fb1/LICENSE
"requests-mock",
]
[dependency-groups]
# Codec-bearing packages excluded from the shipped package and container.
# Not published to PyPI. Versions are resolved and tracked in uv.lock.
# docker/install_codec_deps.sh pins these explicitly to their uv.lock versions;
# update the script when uv lock bumps them.
codec = [
"opencv-python-headless",
"pynvvideocodec",
"torchcodec",
"torchvision",
"torchaudio",
]
[build-system]
requires = ["setuptools>=61", "setuptools-scm"]
build-backend = "setuptools.build_meta"
[tool.uv]
managed = true
required-version = ">=0.9.30"
# grpcio is a transitive dependency of ray. Pin the lower bound here to
# ensure uv selects a CVE-safe version across all resolver paths.
# Updated Sun Jun 22, 2026 (CVE remediation)
constraint-dependencies = [
"grpcio>=1.81.0rc1",
]
# override-dependencies overrides transitive dep version pins that conflict with
# Python 3.13 wheel availability. Server venvs inherit this via the editable
# nemo-gym install (uv >=0.11.24).
override-dependencies = [
# segale pins spacy==3.8.4 which has no cp313 wheels; 3.8.13+ does.
"spacy>=3.8.13",
# Codec-bearing packages — never installed in the shipped package or container.
# Binary wheels bundle libavcodec / static FFmpeg executables (H.264, H.265, AAC)
# that may incur MPEG-LA royalties. Servers that genuinely need these declare
# them in their own overrides.txt (requirements.txt servers) or
# [tool.uv] override-dependencies (pyproject.toml servers), which takes
# precedence. Reinstall for testing via docker/install_codec_deps.sh.
"opencv-python-headless; sys_platform == 'never'",
"pynvvideocodec; sys_platform == 'never'",
"torchcodec; sys_platform == 'never'",
"torchvision; sys_platform == 'never'",
"torchaudio; sys_platform == 'never'",
"pycountry; sys_platform == 'never'",
]
# NOTE: server venvs install nemo-gym editably and inherit this list, so anything
# here is also silently dropped from them (uv >=0.11.24). Servers that need a
# dropped package must re-enable it via their own overrides.txt or
# [tool.uv] override-dependencies. Context: https://github.com/NVIDIA-NeMo/Gym/pull/1835
exclude-dependencies = [
# fasttext-wheel has no cp313 wheels and fails to compile on Python 3.13
# (missing #include <cstdint> in src/args.cc). Excluded as a transitive dep
# of unbabel-comet; wmt_translation does not import fasttext at runtime.
"fasttext-wheel",
# Exclude unwanted dependencies from mlflow
"alembic",
"blinker",
"cryptography",
"flask",
"flask-cors",
"graphene",
"graphql-core",
"graphql-relay",
"gunicorn",
"huey",
"prettytable",
"skops",
"sqlalchemy",
"wcwidth",
"werkzeug",
"waitress",
# diskcache has unfixed CVEs and is no longer a transitive dep since vllm>=0.24.0.
# Explicitly block it to prevent re-introduction via future transitive pulls.
"diskcache",
]
# nemo-lens has no 0.2.0 release on PyPI yet (only 0.1.0), and Gym needs post-0.1.0 APIs
# (compact single-line JSON console export, the gym.* instruments). Pin the git rev until
# 0.2.0 is published, then delete this table and put a version range on the extra above.
# NOTE: [tool.uv.sources] is a uv-only mechanism and is NOT recorded in a built wheel, so
# `pip install nemo-gym[telemetry]` from PyPI resolves nemo-lens 0.1.0 from PyPI instead.
# The pin governs source checkouts, `uv sync`, and the uv lock — including the per-server
# venvs that `gym env test` / `gym env start` build, which inherit it through the editable
# nemo-gym install exactly as override-dependencies does.
[tool.uv.sources]
nemo-lens = { git = "https://github.com/NVIDIA-NeMo/Lens.git", rev = "b85578fc2b736a1804705e537001b5f45e9c715d" }
[tool.setuptools.package-data]
# The built-in asset trees (resources_servers, responses_api_agents, responses_api_models,
# benchmarks, environments — all under [tool.setuptools.packages.find]) ship their configs, READMEs,
# and example data into the wheel via the setuptools-scm VCS file-finder, which includes git-tracked
# files. (Adding `environments` to packages.find above is what makes that tree ship at all.) Bulk
# train/validation JSONL is intentionally not committed to git, so it is excluded automatically.
# Only nemo_gym's own non-package resource scripts need an explicit entry here.
nemo_gym = ["resources/*.py"]
[tool.setuptools.dynamic]
version = {attr = "nemo_gym.__version__"}
readme = {file = "README.md", content-type = "text/markdown"}
[tool.distutils.egg_info]
egg_base = "cache"
[project.urls]
Download = "https://github.com/NVIDIA-NeMo/Gym/releases"
Homepage = "https://github.com/NVIDIA-NeMo/Gym"
[project.scripts]
gym = "nemo_gym.cli.main:main"
ng = "nemo_gym.cli.main:main"
########################## DEPRECATED COMMANDS ##########################
# Run/test scripts for servers.
nemo_gym_run = "nemo_gym.cli.legacy:main"
ng_run = "nemo_gym.cli.legacy:main"
nemo_gym_test = "nemo_gym.cli.legacy:main"
ng_test = "nemo_gym.cli.legacy:main"
nemo_gym_test_all = "nemo_gym.cli.legacy:main"
ng_test_all = "nemo_gym.cli.legacy:main"
# Development convenience aliases.
nemo_gym_dev_test = "nemo_gym.cli.legacy:main"
ng_dev_test = "nemo_gym.cli.legacy:main"
nemo_gym_init_resources_server = "nemo_gym.cli.legacy:main"
ng_init_resources_server = "nemo_gym.cli.legacy:main"
# Benchmarks
nemo_gym_list_benchmarks = "nemo_gym.cli.legacy:main"
ng_list_benchmarks = "nemo_gym.cli.legacy:main"
nemo_gym_prepare_benchmark = "nemo_gym.cli.legacy:main"
ng_prepare_benchmark = "nemo_gym.cli.legacy:main"
# Rollout collection
nemo_gym_collect_rollouts = "nemo_gym.cli.legacy:main"
ng_collect_rollouts = "nemo_gym.cli.legacy:main"
nemo_gym_e2e_collect_rollouts = "nemo_gym.cli.legacy:main"
ng_e2e_collect_rollouts = "nemo_gym.cli.legacy:main"
nemo_gym_aggregate_rollouts = "nemo_gym.cli.legacy:main"
ng_aggregate_rollouts = "nemo_gym.cli.legacy:main"
# Prompt materialization
nemo_gym_materialize_prompts = "nemo_gym.cli.legacy:main"
ng_materialize_prompts = "nemo_gym.cli.legacy:main"
# Reward profiling
nemo_gym_reward_profile = "nemo_gym.cli.legacy:main"
ng_reward_profile = "nemo_gym.cli.legacy:main"
# Dataset management
nemo_gym_upload_dataset_to_gitlab = "nemo_gym.cli.legacy:main"
ng_upload_dataset_to_gitlab = "nemo_gym.cli.legacy:main"
nemo_gym_download_dataset_from_gitlab = "nemo_gym.cli.legacy:main"
ng_download_dataset_from_gitlab = "nemo_gym.cli.legacy:main"
nemo_gym_prepare_data = "nemo_gym.cli.legacy:main"
ng_prepare_data = "nemo_gym.cli.legacy:main"
# HF dataset upload and download
nemo_gym_upload_dataset_to_hf = "nemo_gym.cli.legacy:main"
ng_upload_dataset_to_hf = "nemo_gym.cli.legacy:main"
nemo_gym_download_dataset_from_hf = "nemo_gym.cli.legacy:main"
ng_download_dataset_from_hf = "nemo_gym.cli.legacy:main"
# Gitlab -> HF (upload then delete)
nemo_gym_gitlab_to_hf_dataset = "nemo_gym.cli.legacy:main"
ng_gitlab_to_hf_dataset = "nemo_gym.cli.legacy:main"
# Manually delete from Gitlab
nemo_gym_delete_dataset_from_gitlab = "nemo_gym.cli.legacy:main"
ng_delete_dataset_from_gitlab = "nemo_gym.cli.legacy:main"
# Configuration utils
nemo_gym_dump_config = "nemo_gym.cli.legacy:main"
ng_dump_config = "nemo_gym.cli.legacy:main"
nemo_gym_validate = "nemo_gym.cli.legacy:main"
ng_validate = "nemo_gym.cli.legacy:main"
# Display help
nemo_gym_help = "nemo_gym.cli.legacy:main"
ng_help = "nemo_gym.cli.legacy:main"
# Server status
nemo_gym_status = "nemo_gym.cli.legacy:main"
ng_status = "nemo_gym.cli.legacy:main"
# Environment-specific uv pip list
nemo_gym_pip_list = "nemo_gym.cli.legacy:main"
ng_pip_list = "nemo_gym.cli.legacy:main"
# Display version
nemo_gym_version = "nemo_gym.cli.legacy:main"
ng_version = "nemo_gym.cli.legacy:main"
# Re-install Gym and dependencies
nemo_gym_reinstall = "nemo_gym.cli.legacy:main"
ng_reinstall = "nemo_gym.cli.legacy:main"
[tool.setuptools.packages.find]
where = ["."]
include = [
"benchmarks",
"benchmarks.*",
"resources_servers",
"resources_servers.*",
"responses_api_agents",
"responses_api_agents.*",
"responses_api_models",
"responses_api_models.*",
"environments",
"environments.*",
"nemo_gym",
"nemo_gym.*",
]
################################################
# Testing
################################################
[tool.pytest.ini_options]
# durations=0 will display all tests execution time, sorted in ascending order starting from the slowest one.
# -vv will also display tests with duration = 0.00s
addopts = "--verbose --pyargs --durations=0 --strict-markers" # always add these arguments to pytest
testpaths = ["tests"]
# directories to ignore when discovering tests
norecursedirs = [
"nemo_gym",
"external",
"examples",
"docs",
"scripts",
"tools",
"tutorials",
"deps",
"results",
"*.egg",
".*",
"_darcs",
"build",
"CVS",
"dist",
"venv",
"{arch}"
]
log_cli = true
log_cli_level = "INFO"
cache_dir = "cache/.pytest_cache"
filterwarnings = "ignore::DeprecationWarning"
asyncio_mode = "auto"
# markers to select tests, use `pytest --markers` to see all available markers, `pytest -m "<marker>"` to select tests
markers = [
"unit: marks unit test, i.e. testing a single, well isolated functionality (deselect with '-m \"not unit\"')",
"integration: marks test checking the elements when integrated into subsystems (deselect with '-m \"not integration\"')",
"system: marks test working at the highest integration level (deselect with '-m \"not system\"')",
"acceptance: marks test checking whether the developed product/model passes the user defined acceptance criteria (deselect with '-m \"not acceptance\"')",
"docs: mark tests related to documentation (deselect with '-m \"not docs\"')",
"sandbox: marks sandbox unit tests (deselect with '-m \"not sandbox\"')",
"skipduringci: marks tests that are skipped during ci as they are addressed by Jenkins jobs but should be run to test user setups",
"pleasefixme: marks tests that are broken and need fixing",
]
[tool.coverage.run]
command_line = "-m pytest --durations=10"
omit = [
"tests/*",
"temp*",
"results/*",
"/tmp/*",
"benchmarks/*",
"environments/*",
"scripts/*",
]
data_file = "results/.coverage"
concurrency = ["thread", "multiprocessing"]
[tool.coverage.paths]
source = ["nemo_gym/", "/workspace/nemo_gym"]
[tool.coverage.html]
directory = "results/htmlcov"
[tool.coverage.report]
skip_covered = true
sort = "miss"
fail_under = 96.0
exclude_also = [
"def __repr__",
"if self.debug:",
"if settings.DEBUG",
"raise AssertionError",
"raise NotImplementedError",
"if 0:",
"if __name__ == .__main__.:",
"if TYPE_CHECKING:",
"class .*\\bProtocol\\):",
"@(abc\\.)?abstractmethod",
"pass",
]
################################################
# Linting, formatting, and QOL (using ruff)
################################################
[tool.ruff]
# Line length configuration
line-length = 119
target-version = "py313"
cache-dir = "cache/.ruff_cache"
# Exclude common directories that shouldn't be linted
exclude = [
"resources",
".git",
".github",
".venv",
"venv",
"__pycache__",
"*.egg",
"build",
"dist",
"setup.py",
]
# Files to completely ignore
extend-exclude = [
"*.ipynb",
# Vendored apple/ToolSandbox source — kept verbatim (see its VENDORING.md).
"resources_servers/toolsandbox/tool_sandbox",
]
[tool.ruff.lint]
# Configure linting rules
select = [
"F541", # f-string without any placeholders
"F841", # local variable assigned but never used
"F401", # imported but unused
"E741", # ambiguous variable name
"F821", # undefined name
"E266", # too many leading '#' for block comment
"I", # isort
]
# Additional rules can be added here
ignore = [
"E501", # Line too long - handled by formatter
]
[tool.ruff.lint.isort]
known-first-party = ["nemo_gym"]
known-third-party = ["examples", "scripts"]
section-order = ["future", "standard-library", "third-party", "first-party", "local-folder"]
lines-after-imports = 2
[tool.ruff.lint.per-file-ignores]
# Ignore import violations in __init__ files
"__init__.py" = ["F401", "F403"]
# Ignore docstring requirements in test files
"test_*.py" = ["D101", "D103"]
"*_test.py" = ["D101", "D103"]
"tests/*.py" = ["D101", "D103"]
[tool.ruff.format]
# Code formatting configuration
quote-style = "double"
skip-magic-trailing-comma = false
line-ending = "auto"