Skip to content

feat(build): Cleanup vendor script, add new nemo-platform[all] group#90

Merged
matthewgrossman merged 3 commits into
mainfrom
mgrossman/aircore-654-add-all-extra-alias-for-packaged-nemo-platform-installs
May 28, 2026
Merged

feat(build): Cleanup vendor script, add new nemo-platform[all] group#90
matthewgrossman merged 3 commits into
mainfrom
mgrossman/aircore-654-add-all-extra-alias-for-packaged-nemo-platform-installs

Conversation

@matthewgrossman
Copy link
Copy Markdown
Contributor

@matthewgrossman matthewgrossman commented May 28, 2026

Closes AIRCORE-654.

Summary

Adds a new nemo-platform[all] extra as the recommended user-facing install path, and uses the opportunity to clean up vendor_package.py.

What changed

nemo-platform[all] extra

pip install nemo-platform[all] now resolves to the same dependency set as [services]. The existing [services] extra is preserved for backwards compatibility. User-facing docs, tutorials, and the CLI's "missing pyleak" hint message have all been updated to recommend [all].

all is declared as a hand-written extra directly in packages/nemo_platform/pyproject.toml, sitting alongside the auto-generated extras in the same table.

Vendor flow simplification

The vendor flow already supported a "comment-marked = generated, no-comment = hand-written" convention for [project.optional-dependencies], but the implementation had grown to several passes (annotate, reset-marked, copy-from-bundle, sort) with a lot of incidental complexity around carrying comment trivia through tomlkit table rewrites.

This PR consolidates that into a single function (_refresh_bundle_owned_optional_dependencies) that:

  • Walks the existing table once.
  • Classifies each key by whether it has the # Generated from [tool.bundle-package]; do not edit by hand. marker comment immediately above it.
  • Refreshes vendor-owned keys (those whose names are still produced by [tool.bundle-package]).
  • Drops stale vendor-owned keys (marker present but bundle no longer claims the name).
  • Preserves hand-written keys (no marker) in their original position.
  • Emits vendor-owned keys alphabetically below the hand-written ones.

The marker comment is the load-bearing signal that distinguishes vendor-owned from hand-written. This is the same convention the vendor flow was already using, just implemented more directly.

Dead code removal

Removed ~10 helpers in vendor_package.py that had no callers (_merge_project_scripts, _merge_project_entrypoints, four _remove_* script/entry-point helpers, _merge_client_source_imports, _build_module_rewrites, _remove_empty_generated_project_tables, _merge_project_optional_dependencies). Some were dead before this PR; some became dead as a result of the refresh-function consolidation.

Net: vendor_package.py is ~110 lines smaller.

Verification

  • make vendor is idempotent on the wrapper, nemo-data-designer, and nemo-platform-plugin.
  • Stale-cleanup verified by injecting a fake # Generated...-marked extra in both wrapper and plugin pyprojects; both are removed on the next vendor run.
  • Hand-written extras (all on the wrapper, test on nemo-data-designer) survive across vendor runs.
  • 38/38 services CLI tests pass (packages/nemo_platform_ext/tests/cli/commands/test_services.py).
  • uv run pre-commit run -a passes (ruff, format, ty, uv lock).
  • uv lock --check confirms nemo-platform[all] resolves to the same dependency set as [services].

Acceptance criteria (from AIRCORE-654)

  • uv tool install 'nemo-platform[all]' installs the same service-capable package dependencies currently provided by nemo-platform[services].
  • Existing nemo-platform[services] installs continue to work.
  • User-facing docs and setup output prefer nemo-platform[all] for the full packaged install path.
  • Lock and packaging metadata updated consistently.

Signed-off-by: Matthew Grossman mgrossman@nvidia.com

Summary by CodeRabbit

  • Documentation

    • Updated all installation instructions to use nemo-platform[all] instead of nemo-platform[services] across CLI docs, tutorials, and SDK guidance.
  • Tests

    • Updated test assertions to reflect the new installation command references.
  • Chores

    • Updated package configuration and CLI error hints to reference the new installation extras.

Review Change Stack

Signed-off-by: Matthew Grossman <mgrossman@nvidia.com>
@matthewgrossman matthewgrossman requested review from a team as code owners May 28, 2026 17:37
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 28, 2026

Documentation preview is ready

Preview: https://nvidia-nemo.github.io/nemo-platform/pr-preview/pr-90/pr-90/

Built from 619fe9f in workflow run.

This preview is deployed from this PR branch, updates when docs changes are pushed, and will be removed when the PR closes.

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 28, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: ca10f766-c6e5-4e85-8b94-d83e64ddb911

📥 Commits

Reviewing files that changed from the base of the PR and between 69f035e and 619fe9f.

📒 Files selected for processing (2)
  • tools/nemo-platform-sdk-tools/src/nemo_platform_sdk_tools/sdk/vendor/vendor_package.py
  • tools/nemo-platform-sdk-tools/tests/sdk/vendor/test_vendor_package.py
🚧 Files skipped from review as they are similar to previous changes (1)
  • tools/nemo-platform-sdk-tools/src/nemo_platform_sdk_tools/sdk/vendor/vendor_package.py

📝 Walkthrough

Walkthrough

Adds an all optional-dependencies alias, refactors vendoring to refresh and annotate vendor-owned extras, updates wrapper pyproject/README and plugin metadata, and replaces nemo-platform[services] with nemo-platform[all] across docs, CLI messages, and tests.

Changes

Install [all] extra and vendoring infrastructure

Layer / File(s) Summary
Vendoring tool: optional-dependencies refresh and annotation
tools/nemo-platform-sdk-tools/.../vendor/vendor_package.py
Introduces pattern-based merging, removes legacy removal helpers, and adds _refresh_bundle_owned_optional_dependencies to rebuild [project.optional-dependencies] preserving hand-written extras and alphabetizing vendor-owned extras with generator markers.
Wrapper package metadata and documentation
packages/nemo_platform/pyproject.toml, packages/nemo_platform/README.md, plugins/nemo-data-designer/pyproject.toml
Adds all optional-install alias mapping to nemo-platform[services], cleans up pyproject comments/ordering, and documents marker-based vendor ownership and make vendor behavior.

Documentation and CLI updates to [all] extra

Layer / File(s) Summary
Documentation installation references
docs/cli/index.md, docs/contributing/skills-spec.md, docs/customizer/tutorials/*, docs/evaluator/tutorials/run-llm-judge-evaluation.md, docs/example-applications/tool-calling.ipynb, docs/pysdk/index.md, docs/safe-synthesizer/tutorials/*, docs/support-matrix.md
Replaces install examples and prerequisites from nemo-platform[services] to nemo-platform[all] across Markdown and notebook tutorials.
CLI error message and test updates
packages/nemo_platform_ext/src/nemo_platform_ext/cli/commands/services/cli.py, packages/nemo_platform_ext/tests/cli/commands/test_services.py
Updates the services CLI extra-install hint and adjusts three tests to expect nemo-platform[all] in stderr.

Suggested reviewers:

  • mckornfield
  • BrianNewsom
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 48.65% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed Title directly corresponds to the PR's main changes: adding a new nemo-platform[all] extra and refactoring the vendor script cleanup.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch mgrossman/aircore-654-add-all-extra-alias-for-packaged-nemo-platform-installs

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In
`@tools/nemo-platform-sdk-tools/src/nemo_platform_sdk_tools/sdk/vendor/vendor_package.py`:
- Around line 1192-1201: The current code unconditionally clears
project["optional-dependencies"], removing user-defined extras; instead, only
remove generated extras: when bundle_config is truthy and
"optional-dependencies" in project, iterate the keys of
project["optional-dependencies"] and delete only those whose names match the
generated groups described by the bundle config (e.g., derive the list of
generated group names from bundle_config or a known prefix), set changed = True
if any key was removed, and leave other manual extras intact rather than
replacing the whole table; use the variables project, bundle_config,
member_config, member_content and cleaned_member_content to locate and implement
this selective cleanup.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: a32b6ea0-c663-4deb-8060-85b4cf9793a2

📥 Commits

Reviewing files that changed from the base of the PR and between de31578 and 93ec670.

⛔ Files ignored due to path filters (4)
  • sdk/python/nemo-platform/src/nemo_platform/cli/commands/services/cli.py is excluded by !sdk/**
  • sdk/python/nemo-platform/tests/vendored/nemo_platform_ext/cli/commands/test_services.py is excluded by !sdk/**
  • sdk/python/overrides/nemo-platform/README/02_installation.md is excluded by !sdk/**
  • uv.lock is excluded by !**/*.lock
📒 Files selected for processing (23)
  • docs/cli/index.md
  • docs/contributing/skills-spec.md
  • docs/customizer/tutorials/_snippets/customizer-prereqs.md
  • docs/customizer/tutorials/distillation-customization-job.ipynb
  • docs/customizer/tutorials/dpo-customization-job.ipynb
  • docs/customizer/tutorials/embedding-customization-job.ipynb
  • docs/customizer/tutorials/lora-customization-job.ipynb
  • docs/customizer/tutorials/optimize-throughput.ipynb
  • docs/customizer/tutorials/sft-customization-job.ipynb
  • docs/evaluator/tutorials/run-llm-judge-evaluation.md
  • docs/example-applications/tool-calling.ipynb
  • docs/pysdk/index.md
  • docs/safe-synthesizer/tutorials/differential-privacy.md
  • docs/safe-synthesizer/tutorials/index.md
  • docs/safe-synthesizer/tutorials/safe-synthesizer-101.md
  • docs/support-matrix.md
  • packages/nemo_platform/README.md
  • packages/nemo_platform/pyproject.toml
  • packages/nemo_platform_ext/src/nemo_platform_ext/cli/commands/services/cli.py
  • packages/nemo_platform_ext/tests/cli/commands/test_services.py
  • packages/nemo_platform_plugin/pyproject.toml
  • plugins/nemo-data-designer/pyproject.toml
  • tools/nemo-platform-sdk-tools/src/nemo_platform_sdk_tools/sdk/vendor/vendor_package.py
💤 Files with no reviewable changes (1)
  • packages/nemo_platform_plugin/pyproject.toml

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 28, 2026

Suite Lines Covered Line Rate Branch Rate
Unit Tests 18293/24245 75.4% 61.9%
Integration Tests 11693/23022 50.8% 26.0%

Signed-off-by: Matthew Grossman <mgrossman@nvidia.com>
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 28, 2026

Actionable comments posted: 0

Comment thread packages/nemo_platform/pyproject.toml
CI was failing because three tests referenced helpers removed by this
PR (_remove_marked_optional_dependency_groups,
_annotate_optional_dependency_groups), and a fourth test asserted
per-key markers on mixed scripts/entry-points tables — a mode that no
longer exists.

* Replace the three removed-helper tests with coverage for the new
  _refresh_bundle_owned_optional_dependencies (preserves hand-written
  extras, drops stale generated extras, emits the marker for unmarked
  bundle-owned keys, alphabetizes vendor-owned).

* Tighten _annotate_generated_project_table so it only emits the
  table-level header when the table is wholly bundle-generated. Mixed
  tables (containing any hand-written entry) are left unannotated, which
  matches the rebuild model and what the wrapper actually emits today.

* Update test_annotate_generated_project_entries_marks_generated_entries
  accordingly: wholly-generated entry-point tables get the header,
  mixed scripts/entry-point tables stay unannotated.

Signed-off-by: Matthew Grossman <mgrossman@nvidia.com>
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 28, 2026

Actionable comments posted: 0

Comment thread packages/nemo_platform/pyproject.toml
Comment thread packages/nemo_platform/pyproject.toml
Comment thread uv.lock
@matthewgrossman matthewgrossman enabled auto-merge May 28, 2026 23:23
@matthewgrossman matthewgrossman added this pull request to the merge queue May 28, 2026
Merged via the queue into main with commit d92d4e9 May 28, 2026
27 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants