Skip to content

feat: bring rvctool up to date with rtbtool/mvtbtool, add --test smoke test - #33

Merged
petercorke merged 3 commits into
mainfrom
feat/rvctool-parity-and-smoke-tests
Aug 13, 2026
Merged

feat: bring rvctool up to date with rtbtool/mvtbtool, add --test smoke test#33
petercorke merged 3 commits into
mainfrom
feat/rvctool-parity-and-smoke-tests

Conversation

@petercorke

Copy link
Copy Markdown
Owner

Summary

Catches rvctool up to feature parity with its siblings (rtbtool/mvtbtool), and adds the smoke-test capability requested for it specifically:

  • New --test flag + run_smoke_test(): prints real package versions, then one real functional check per toolbox (RTB fkine, MVTB Image.smooth, spatialgeometry Cuboid, spatialmath SE3 composition, Open3D PointCloud, and bdsim -- running vloop_test.py's block diagram non-interactively). Missing optional deps (Open3D) are reported as FAIL with reason, not silently skipped. Mirrors mvtbtool's own --test design.
  • New tests/test_bin.py, mirroring MVTB's tests/test_bin.py pattern: subprocess-invokes rvctool --help/--test, asserts exit codes and expected PASS/FAIL output.
  • New RVC3/bin/_bintools.py: line-wrapping argparse help formatter, RVC3's own copy of the same private helper RTB/MVTB each keep in their own bin/ package.
  • New RVCTOOL_OPTIONS env var (RVCTOOL kept for backward compat, now prints a deprecation warning when used).
  • New --torch and --reload flags, matching mvtbtool/rtbtool.
  • Version banner rewritten: wrapped multi-line (was a single unwrapped line), now includes bdsim and Open3D ("not installed" if missing) alongside RTB/MVTB/SG/SMTB/NumPy/SciPy/Matplotlib. Fixes a bug where SG's line reported spatialmath-python's version twice instead of spatialgeometry's own.
  • IPython/pygments/traitlets imports guarded with a friendly install message instead of a hard top-level import failure.
  • Fixed the %precision startup line spuriously auto-displaying its own return value (bare Out[]: '%.3g;' printed before the first real prompt) -- same class of bug also just fixed upstream in rtbtool (fix: rtbtool's %precision line spuriously echoes its own return value robotics-toolbox-python#592) and mvtbtool (fix: mvtbtool's %precision line spuriously echoes with --showassign machinevision-toolbox-python#79).
  • Suppressed IPython's own generic startup banner (Python/IPython version, tips) since rvctool already prints its own richer one.
  • Fixed a real bug surfaced live while testing: exec("from spatialgeometry import *", globs) injects SG's exported names directly into the module's own globals(), including a class also named Path -- silently shadowing pathlib.Path for the rest of the function. Switched all internal path handling to explicit pathlib.Path so it can't be shadowed by a wildcard import.
  • mvb import alias fixed to match what the banner actually advertises (was bound as mvbase in code but mvb in the printed banner text).
  • README: documented rvctool --test as a post-install sanity check, and updated the example transcript to match (removed IPython's now-suppressed native banner lines).

Test plan

  • rvctool --help -- exits 0, well-formatted
  • rvctool --test -- reports PASS/FAIL per toolbox, exits 1 when Open3D genuinely missing
  • rvctool (default interactive startup) -- confirmed clean banner, no double-banner, no spurious echo, verified live
  • python -m unittest tests.test_bin -- 2 passed

…e test

Catches rvctool up to feature parity with its siblings, and adds the
smoke-test capability requested for it specifically (RTB/MVTB's own
CLI tools get their smoke tests in their own repos):

- New --test flag + run_smoke_test(): prints real package versions,
  then one real functional check per toolbox (RTB fkine, MVTB
  Image.smooth, spatialgeometry Cuboid, spatialmath SE3 composition,
  Open3D PointCloud, and bdsim -- running vloop_test.py's block
  diagram non-interactively). Missing optional deps (Open3D) are
  reported as FAIL with reason, not silently skipped. Mirrors
  mvtbtool's own --test design.
- New tests/test_bin.py, mirroring MVTB's tests/test_bin.py pattern:
  subprocess-invokes `rvctool --help`/`--test`, asserts exit codes and
  expected PASS/FAIL output.
- New RVC3/bin/_bintools.py: line-wrapping argparse help formatter,
  RVC3's own copy of the same private helper RTB/MVTB each keep in
  their own bin/ package.
- New RVCTOOL_OPTIONS env var (RVCTOOL kept for backward compat, now
  prints a deprecation warning when used).
- New --torch and --reload flags, matching mvtbtool/rtbtool.
- Version banner rewritten: wrapped multi-line (was a single unwrapped
  line), now includes bdsim and Open3D ("not installed" if missing)
  alongside RTB/MVTB/SG/SMTB/NumPy/SciPy/Matplotlib. Fixes a bug where
  SG's line reported spatialmath-python's version twice instead of
  spatialgeometry's own.
- IPython/pygments/traitlets imports guarded with a friendly install
  message instead of a hard top-level import failure.
- Fixed the %precision startup line spuriously auto-displaying its own
  return value (e.g. bare `Out[]: '%.3g;'` printed before the first
  real prompt) -- same class of bug also just fixed upstream in
  rtbtool and mvtbtool.
- Suppressed IPython's own generic startup banner (Python/IPython
  version, tips) since rvctool already prints its own richer one;
  having both stacked was redundant and visually confusing.
- Fixed a real bug surfaced live while testing: `exec("from
  spatialgeometry import *", globs)` injects SG's exported names
  directly into the module's own globals(), including a class also
  named `Path` -- silently shadowing `pathlib.Path` for the rest of
  the function. Switched all internal path handling to explicit
  `pathlib.Path` so it can't be shadowed by a wildcard import.
- mvb import alias fixed to match what the banner actually advertises
  (was bound as `mvbase` in code but `mvb` in the printed banner text).
- README: documented `rvctool --test` as a post-install sanity check.
display_banner is now unconditionally False (rvctool prints its own
richer banner instead), so these two lines no longer appear in real
output -- remove them rather than leave a stale line in the example.
@petercorke
petercorke merged commit b334549 into main Aug 13, 2026
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.

1 participant