Skip to content

refactor(cli): replace the cli_setup_command shim with a moved-path entry - #5300

Merged
ananthsub merged 1 commit into
mainfrom
ananthsub/layout-cli
Nov 3, 2026
Merged

ananthsub merged 1 commit into
mainfrom
ananthsub/layout-cli

Conversation

@ananthsub

@ananthsub ananthsub commented Oct 29, 2026 •

Copy link
Copy Markdown
Contributor

What and why

The last move of the reorganization. Everything the CLI runs already lives in nemo_gym/cli/, and #5195 moved did_you_mean to utils/text.py. What was left at the top of nemo_gym/ was cli_setup_command.py, a deprecation shim from an earlier CLI refactor that forwarded run_command and setup_env_command to the module now at orchestration/server_venv.py. This PR replaces the shim with a MOVED_MODULES entry, so the old path works like every other moved path: the same module object, one warning, removal in 0.10.0.

Where this PR sits

The stack lands bottom-up; each PR's base is the branch of the PR before it, so each diff shows only that PR's change.

flowchart LR
  compat["#5167<br/>Old import paths<br/>keep working"]
  linter["#5168<br/>import-linter<br/>layer contract"]
  prep["#5169<br/>Remove path and<br/>name couplings"]
  config["#5189<br/>Move config/"]
  utils["#5195<br/>Move utils/"]
  core["#5203<br/>Move core/"]
  client["#5206<br/>Move client/,<br/>start telemetry/"]
  trajectory["#5209<br/>Move trajectory/"]
  verification["#5210<br/>Move verification/"]
  metrics["#5211<br/>Move metrics/"]
  artifacts["#5212<br/>Move artifacts/"]
  srmods["#5214<br/>Move server_runtime/<br/>modules"]
  su["#5215<br/>Split server_utils"]
  model["#5224<br/>Move models/<br/>modules"]
  modelbase["#5225<br/>Split model<br/>call capture"]
  agents["#5228<br/>Move agents/"]
  data["#5229<br/>Move data/"]
  harbor["#5230<br/>Split the<br/>Harbor task CLI"]
  rollouts["#5231<br/>Move rollouts/"]
  rsplit["#5232<br/>Split the<br/>rollout collector"]
  testing["#5233<br/>Dissolve testing/"]
  orch["#5234<br/>Move orchestration/<br/>modules"]
  sup["#5235<br/>Split the<br/>server supervisor"]
  eval["#5244<br/>Move eval/"]
  env["#5298<br/>Move environment/<br/>registries"]
  cli["#5300<br/>Retire the<br/>cli_setup_command shim"]
  docs["#5385<br/>Describe the<br/>package layout"]
  owners["next<br/>CODEOWNERS:<br/>per-package groups"]
  remove["0.10.0<br/>Remove the<br/>old paths"]
  compat --> linter
  linter --> prep
  prep --> config
  config --> utils
  utils --> core
  core --> client
  client --> trajectory
  trajectory --> verification
  verification --> metrics
  metrics --> artifacts
  artifacts --> srmods
  srmods --> su
  su --> model
  model --> modelbase
  modelbase --> agents
  agents --> data
  data --> harbor
  harbor --> rollouts
  rollouts --> rsplit
  rsplit --> testing
  testing --> orch
  orch --> sup
  sup --> eval
  eval --> env
  env --> cli
  cli --> docs
  docs --> owners
  owners --> remove
  classDef this fill:#fde68a,stroke:#b45309,stroke-width:2px,color:#1f2937
  classDef later fill:#f3f4f6,stroke:#9ca3af,color:#4b5563,stroke-dasharray: 4 3
  class cli this
  class owners,remove later
Loading

After this PR, the top of nemo_gym/ holds only the packages, __init__.py, package_info.py, the compatibility table _moved_paths.py, the public API helper _public_api.py, and verifiers/, the standard-library-only package that sandbox verifiers import by name.

How to review

One commit:

  • nemo_gym/cli_setup_command.py is removed and recorded in MOVED_MODULES as moved to nemo_gym.orchestration.server_venv.
  • The contract's CLI layer and CODEOWNERS no longer name the file.
  • Two CLI compat test cases expected a warning on attribute access; the warning now comes once, on import of the old path, as for every moved module, and the moved-path tests cover it. The recorded import surface keeps the two names the shim served, which the moved module still has, and drops the shim's own import of moved_attr_getter, which was never API.

Public API

Every layout package that exists after this PR has a lazy public API in its __init__.py: the names code outside nemo_gym/ imports from it (servers and their tests, benchmarks, scripts, and code samples in docs and skills), plus every name it already exported, each served from the submodule that defines it on first use. Code outside nemo_gym/ and its tests (servers and their tests, benchmarks, scripts, and docs) imports those names from nemo_gym.<package>, so later moves inside a package leave it alone. Code inside nemo_gym/, and the library's tests under tests/, import from the module that defines each name, so the import-linter contract sees every dependency and a test reads what it patches. A patch target names the module the code under test looks the name up in. AGENTS.md states the rule.

Validation

  • pytest -n 16 tests/unit_tests, also with -W error for the old path. The only failures are environment-specific, as in the other PRs.
  • from nemo_gym.cli_setup_command import run_command, setup_env_command resolves to the objects in orchestration/server_venv.py, with one warning.
  • lint-imports; pre-commit run on the changed files.

Rollout evidence: N/A.

Compatibility

  • nemo_gym.cli_setup_command keeps working until 0.10.0. It now warns once on import instead of on each attribute access.

Issue

Part of #5166.

@copy-pr-bot

copy-pr-bot Bot commented Oct 29, 2026

Copy link
Copy Markdown

Auto-sync is disabled for draft pull requests in this repository. Workflows must be run manually.

Contributors can view more details about this message here.

@svcnvidia-nemo-ci svcnvidia-nemo-ci added area:cli Command-line interfaces and user-facing command behavior feature New capabilities, enhancements, or enablement work labels Oct 29, 2026
@ananthsub ananthsub added area:core Shared APIs, servers, telemetry, health, and registries needs-review PR is ready for code review and waiting on a reviewer labels Oct 29, 2026
@ananthsub
ananthsub requested a review from yaoyu-33 October 29, 2026 13:17
@ananthsub
ananthsub marked this pull request as ready for review October 29, 2026 13:17
@ananthsub
ananthsub requested a review from a team as a code owner October 29, 2026 13:17
@nemo-automation-bot
nemo-automation-bot Bot requested review from a team October 29, 2026 13:17

@svcnvidia-nemo-ci svcnvidia-nemo-ci left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

SHIP — LGTM — no concerns found.

The new moved-path entry preserves canonical module identity through the existing finder. The compatibility suite covers from-imports and once-per-path warnings, while its real-module identity check automatically includes this alias. The layer and ownership cleanup matches the deleted shim.

Reviewed all six changed files and directly affected import, CLI, packaging, and test contracts. Static review only; tests were not executed.

Note: formal approval is not available for this request, so this review is posted as a comment only.

Review generated by codex. This was a full review. Request a full review with /review reset=true.

@ananthsub
ananthsub force-pushed the ananthsub/layout-cli branch from 9620499 to 76df16b Compare October 29, 2026 17:01
@ananthsub
ananthsub force-pushed the ananthsub/layout-cli branch from 76df16b to 13b922d Compare October 29, 2026 18:25
@ananthsub
ananthsub force-pushed the ananthsub/layout-cli branch from 13b922d to 942e856 Compare October 29, 2026 19:04
@ananthsub
ananthsub force-pushed the ananthsub/layout-cli branch from 942e856 to eaf6bf0 Compare October 29, 2026 19:32
@ananthsub
ananthsub force-pushed the ananthsub/layout-cli branch from eaf6bf0 to 182ca73 Compare October 30, 2026 01:28
…ntry

nemo_gym/cli_setup_command.py was a deprecation shim from an earlier
CLI refactor that forwarded run_command and setup_env_command to the
module now at orchestration/server_venv.py. Record
nemo_gym.cli_setup_command in MOVED_MODULES instead, so the old path is
the same module object as orchestration/server_venv.py, warns once like
every other moved path, and is removed in 0.10.0. The contract's CLI
layer and CODEOWNERS no longer name the file. The two CLI compat test
cases that expected a warning on attribute access are dropped (the
moved-path tests cover the module), and the recorded import surface no
longer lists the shim's own import of moved_attr_getter.

Signed-off-by: Ananth Subramaniam <[email protected]>

This branch was previously deployed

1 inactive deployment
public — d5ee75aa Deployed Nov 4, 2026 by copy-pr-bot[bot] via release / finalize / notify #9687
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:cli Command-line interfaces and user-facing command behavior area:core Shared APIs, servers, telemetry, health, and registries feature New capabilities, enhancements, or enablement work needs-review PR is ready for code review and waiting on a reviewer sla:review-overdue Review response is over the one-business-day SLA

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants