feat(rtbtool): add 'tool' extra for IPython/pygments#562
Open
petercorke wants to merge 1 commit into
Open
Conversation
… 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 Report❌ Patch coverage is
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. 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
rtbtoolimportedIPython,pygments, andtraitletsunconditionally at module scope, but none were declared as a dependency anywhere —pip install roboticstoolbox-pythonfollowed by runningrtbtoolcrashed with a rawModuleNotFoundErrorunless IPython happened to already be present transitively (e.g. via Jupyter).main(), guarded by a try/except that points the user at a newtoolextra (pip install roboticstoolbox-python[tool]) instead of a bare traceback.tool = ["ipython", "pygments"]topyproject.toml, folded intoall, and documented in README.md/docs/source/install.rst alongside the existingswift/qp/collisionextras.mvtbtool(same gap) in a separate PR.Test plan
pip install roboticstoolbox-python[tool]python -m roboticstoolbox.bin.rtbtool --no-banner) still drops into an IPython shell correctly🤖 Generated with Claude Code