Skip to content

Fix failures after nvidia-nat-eval isolation#1615

Merged
rapids-bot[bot] merged 2 commits intoNVIDIA:developfrom
willkill07:wkk_bump-example-uv-locks
Feb 19, 2026
Merged

Fix failures after nvidia-nat-eval isolation#1615
rapids-bot[bot] merged 2 commits intoNVIDIA:developfrom
willkill07:wkk_bump-example-uv-locks

Conversation

@willkill07
Copy link
Member

@willkill07 willkill07 commented Feb 19, 2026

Description

  • bumps example uv.lock files
  • adds missing dep for examples/notebooks (already under uv.lock)
  • adds missing uv.lock precommit check for eval and fastmcp
  • conditionally import dask rather than unconditionally
  • clean up testing script to create .venv per project/example with automatic cleanup
  • move prediction_trie back to nvidia-nat-core
  • miscellaneous import cleanups

Closes

By Submitting this PR I confirm:

  • I am familiar with the Contributing Guidelines.
  • We require that all contributors "sign-off" on their commits. This certifies that the contribution is your original work, or you have rights to submit it under the same license, or a compatible license.
    • Any contribution which contains commits that are not Signed-Off will not be accepted.
  • When the PR is ready for review, new or existing tests cover these changes.
  • When the PR is ready for review, the documentation is up to date with these changes.

Summary by CodeRabbit

  • Chores
    • Updated pre-commit hooks configuration to include additional package lock entries for comprehensive dependency management.
    • Enhanced test execution framework with improved virtual environment isolation per project, expanded command-line capabilities for flexible test execution, and refined code coverage tracking mechanisms.

Signed-off-by: Will Killian <wkillian@nvidia.com>
@willkill07 willkill07 self-assigned this Feb 19, 2026
@willkill07 willkill07 requested review from a team as code owners February 19, 2026 16:57
@willkill07 willkill07 added bug Something isn't working non-breaking Non-breaking change labels Feb 19, 2026
@coderabbitai
Copy link

coderabbitai bot commented Feb 19, 2026

Important

Review skipped

Review was skipped as selected files did not have any reviewable changes.

💤 Files selected but had no reviewable changes (1)
  • packages/nvidia_nat_core/src/nat/utils/type_utils.py

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Walkthrough

These changes introduce per-project virtual environment handling in the test runner, replacing shared VENV_DIR usage with individual .venv directories per project. A new CLI argument (extra_flags) is added to propagate custom pytest flags through the execution pipeline, and pre-commit configuration is extended with uv-lock entries for two additional packages.

Changes

Cohort / File(s) Summary
Pre-commit Configuration
.pre-commit-config.yaml
Added two uv-lock entries for packages/nvidia_nat_eval and packages/nvidia_nat_fastmcp to lock their respective pyproject.toml files.
Test Runner Refactoring
ci/scripts/run_tests.py
Refactored virtual environment handling to use per-project .venv directories instead of shared VENV_DIR. Updated function signatures (make_env, run_one, main) to accept project_dir and extra_flags. Restructured sync/test execution flow into try/finally block. Enhanced pytest command composition with optional flags (run_slow, run_integration, coverage). Updated environment variables and cleanup logic to handle per-project venv removal.

Sequence Diagram(s)

sequenceDiagram
    actor CLI
    participant main as main()
    participant make_env as make_env()
    participant uv as uv tools
    participant pytest as pytest
    participant cleanup as cleanup

    CLI->>main: run_tests.py with project_dir, extra_flags
    loop For each project
        main->>make_env: project_dir
        make_env->>make_env: Set VIRTUAL_ENV, UV_PROJECT_ENVIRONMENT
        make_env->>CLI: Return env dict
        
        main->>uv: uv sync (with env)
        uv-->>main: Sync complete
        
        alt Tests exist
            main->>pytest: uv run pytest + coverage + extra_flags
            pytest-->>main: Test results
        else No tests
            main->>main: Exit early
        end
        
        main->>cleanup: Remove project .venv
        cleanup-->>main: Cleanup complete
    end
    main-->>CLI: Return exit code
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title 'Fix failures after nvidia-nat-eval isolation' is concise (46 chars), uses imperative mood ('Fix'), and clearly describes the main issue being addressed in the changeset.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.

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

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

Copy link

@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

🧹 Nitpick comments (1)
ci/scripts/run_tests.py (1)

274-274: Document the -- separator requirement in the extra_flags help text.

With nargs="*", argparse will not consume values starting with - as positional arguments — they are interpreted as unrecognized options and the call will fail. Most useful pytest flags (e.g. -v, -x, --tb=short) start with -, so callers must use -- to separate them. The current help string doesn't mention this.

📝 Proposed fix
-    parser.add_argument("extra_flags", nargs="*", default=[], help="Extra flags to pass to pytest")
+    parser.add_argument("extra_flags",
+                        nargs="*",
+                        default=[],
+                        help="Extra flags to pass to pytest (use '--' to separate from script flags, "
+                             "e.g. run_tests.py --project foo -- -v --tb=short)")
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@ci/scripts/run_tests.py` at line 274, Update the argparse help for the
positional "extra_flags" to mention that flags starting with "-" must be passed
after a "--" separator (because nargs="*" won't capture option-like tokens);
edit the parser.add_argument call that defines extra_flags (nargs="*",
default=[], help="...") to include a concise note like "If passing pytest flags
that start with '-', put them after '--' (e.g. -- -v -x)" so callers know to use
the separator.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@ci/scripts/run_tests.py`:
- Line 175: Replace the explicit str() call inside the f-string used when
appending the coverage argument: in the cmd.append call that currently builds
f"--cov={str(source_dir)}", use the f-string conversion flag instead (i.e.,
f"--cov={source_dir!s}") so Ruff RUF010 is satisfied while preserving the same
string conversion behavior; update the cmd.append expression where source_dir is
referenced.

---

Nitpick comments:
In `@ci/scripts/run_tests.py`:
- Line 274: Update the argparse help for the positional "extra_flags" to mention
that flags starting with "-" must be passed after a "--" separator (because
nargs="*" won't capture option-like tokens); edit the parser.add_argument call
that defines extra_flags (nargs="*", default=[], help="...") to include a
concise note like "If passing pytest flags that start with '-', put them after
'--' (e.g. -- -v -x)" so callers know to use the separator.

Signed-off-by: Will Killian <wkillian@nvidia.com>
@willkill07
Copy link
Member Author

/merge

@rapids-bot rapids-bot bot merged commit c4b19b5 into NVIDIA:develop Feb 19, 2026
22 of 23 checks passed
@willkill07 willkill07 deleted the wkk_bump-example-uv-locks branch February 25, 2026 12:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working non-breaking Non-breaking change

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants