Commit Graph

6 Commits

Author SHA1 Message Date
Oleksandr Pavlyk
63fcd0afc4 Add nvbench_plot_bwutil to mock layout in test 2026-07-02 07:26:49 -05:00
Oleksandr Pavlyk
73e6e8f0f9 Fix unexpected AttributeError when --no-color is used
Implemented robo-review feedback suggesting to expand coverage
of lazy loading helper.
2026-07-02 07:26:49 -05:00
Oleksandr Pavlyk
fd840b427b Harden tooling dependency import tests 2026-07-02 07:26:49 -05:00
Oleksandr Pavlyk
ee66a4d6c1 Only translate ModuleNotFoundError exceptions
require_tooling_dependency() now only translates
ModuleNotFoundError when the missing module is the
requested top-level package. Other import
failures are re-raised unchanged.

This helps in situation where third-party dependency
is installed but broken for whatever reason. Previously
we would intercept it and suggest to run
pip install cuda-bench[tools], but that was already done.
2026-07-02 07:26:49 -05:00
Oleksandr Pavlyk
2bb4ca63a9 Test packaged import path.
test_nvbench_tooling_deps.py now has a smoke test that builds a
temporary package layout matching the wheel mapping:

cuda/bench/scripts/nvbench_tooling_deps.py

and imports:

cuda.bench.scripts.nvbench_tooling_deps

That covers the cuda.bench.scripts.* path without requiring a wheel
build/install inside this unit test.
2026-07-02 07:26:49 -05:00
Oleksandr Pavlyk
02373ec7b2 Load script tooling dependencies lazily
Add a shared nvbench_tooling_deps helper for importing packages required
by NVBench console tools. Missing tooling packages now raise a dedicated
error with an install recipe instead of failing with a raw ImportError.

Update script imports to work both as installed package modules and as
direct source-tree scripts by using the __package__ import pattern for
nvbench_json and the new tooling helper.

Defer nvbench-compare dependencies to the points where they are needed:
NumPy/colorama during normal comparison setup, tabulate during table
rendering, jsondiff only for device mismatch reporting, and plotting
packages only for plot modes.

Update tests to initialize compare tooling when calling internals
directly and add coverage for the tooling dependency loader.

Closes #384
2026-07-02 07:26:49 -05:00