Repository navigation
refactor(cli): replace the cli_setup_command shim with a moved-path entry - #5300
Conversation
|
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
left a comment
There was a problem hiding this comment.
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.
fb50872 to
eebb8eb
Compare
eebb8eb to
1219b46
Compare
9620499 to
76df16b
Compare
76df16b to
13b922d
Compare
13b922d to
942e856
Compare
942e856 to
eaf6bf0
Compare
eaf6bf0 to
182ca73
Compare
…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]>
What and why
The last move of the reorganization. Everything the CLI runs already lives in
nemo_gym/cli/, and #5195 moveddid_you_meantoutils/text.py. What was left at the top ofnemo_gym/wascli_setup_command.py, a deprecation shim from an earlier CLI refactor that forwardedrun_commandandsetup_env_commandto the module now atorchestration/server_venv.py. This PR replaces the shim with aMOVED_MODULESentry, 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.
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, andverifiers/, the standard-library-only package that sandbox verifiers import by name.How to review
One commit:
nemo_gym/cli_setup_command.pyis removed and recorded inMOVED_MODULESas moved tonemo_gym.orchestration.server_venv.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 outsidenemo_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 outsidenemo_gym/and its tests (servers and their tests, benchmarks, scripts, and docs) imports those names fromnemo_gym.<package>, so later moves inside a package leave it alone. Code insidenemo_gym/, and the library's tests undertests/, 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.mdstates the rule.Validation
pytest -n 16 tests/unit_tests, also with-W errorfor 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_commandresolves to the objects inorchestration/server_venv.py, with one warning.lint-imports;pre-commit runon the changed files.Rollout evidence: N/A.
Compatibility
nemo_gym.cli_setup_commandkeeps working until 0.10.0. It now warns once on import instead of on each attribute access.Issue
Part of #5166.