Skip to content

feat(rtbtool): add 'tool' extra for IPython/pygments#562

Open
petercorke wants to merge 1 commit into
mainfrom
feat/tools-extra
Open

feat(rtbtool): add 'tool' extra for IPython/pygments#562
petercorke wants to merge 1 commit into
mainfrom
feat/tools-extra

Conversation

@petercorke

Copy link
Copy Markdown
Owner

Summary

  • rtbtool imported IPython, pygments, and traitlets unconditionally at module scope, but none were declared as a dependency anywhere — pip install roboticstoolbox-python followed by running rtbtool crashed with a raw ModuleNotFoundError unless IPython happened to already be present transitively (e.g. via Jupyter).
  • Moved the imports into main(), guarded by a try/except that points the user at a new tool extra (pip install roboticstoolbox-python[tool]) instead of a bare traceback.
  • Added tool = ["ipython", "pygments"] to pyproject.toml, folded into all, and documented in README.md/docs/source/install.rst alongside the existing swift/qp/collision extras.
  • Companion fix applied to MVTB's mvtbtool (same gap) in a separate PR.

Test plan

  • Simulated missing IPython/pygments → clean error message pointing at pip install roboticstoolbox-python[tool]
  • Normal run (python -m roboticstoolbox.bin.rtbtool --no-banner) still drops into an IPython shell correctly

🤖 Generated with Claude Code

… message when missing

rtbtool imported IPython, pygments, and traitlets unconditionally at
module scope, but none of the three were declared as a dependency
anywhere -- pip install roboticstoolbox-python followed by running
rtbtool crashed with a raw ModuleNotFoundError unless IPython happened
to already be present transitively (e.g. via Jupyter).

Move the imports into main(), guarded by a try/except that points the
user at the new 'tool' extra instead. Since rtbtool is an opt-in
interactive shell rather than something every library user needs, add
it as an extra (matching the existing swift/qp/collision pattern)
rather than making it a core dependency.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@codecov

codecov Bot commented Jul 23, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 0% with 7 lines in your changes missing coverage. Please review.
✅ Project coverage is 0.00%. Comparing base (0bb9645) to head (b791bc8).

Files with missing lines Patch % Lines
src/roboticstoolbox/bin/rtbtool.py 0.00% 7 Missing ⚠️
Additional details and impacted files
@@          Coverage Diff          @@
##            main    #562   +/-   ##
=====================================
  Coverage   0.00%   0.00%           
=====================================
  Files        142     142           
  Lines      13788   13790    +2     
=====================================
- Misses     13788   13790    +2     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

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