Skip to content

feat(mvtbtool): add 'tool' extra for IPython/pygments#24

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

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

Conversation

@petercorke

Copy link
Copy Markdown
Owner

Summary

  • mvtbtool imports IPython, pygments, and traitlets inside main(), but none were declared as a dependency anywhere — pip install machinevision-toolbox-python followed by running mvtbtool crashed with a raw ModuleNotFoundError unless IPython happened to already be present transitively (e.g. via Jupyter). Same gap found and fixed in roboticstoolbox-python's rtbtool (companion PR).
  • Wrapped the imports in a try/except that points the user at a new tool extra (pip install machinevision-toolbox-python[tool]) instead of a bare traceback.
  • Added tool = ["ipython", "pygments"] to pyproject.toml, folded into all, and documented in docs/source/installation.rst's extras table alongside the existing ros/jupyter/torch extras.

Test plan

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

🤖 Generated with Claude Code

…r message when missing

mvtbtool imports IPython, pygments, and traitlets inside main(), but
none of the three were declared as a dependency anywhere -- pip
install machinevision-toolbox-python followed by running mvtbtool
crashed with a raw ModuleNotFoundError unless IPython happened to
already be present transitively (e.g. via Jupyter). Same gap as
roboticstoolbox-python's rtbtool, fixed there first.

Wrap the imports in a try/except that points the user at the new
'tool' extra instead. Added as an extra (matching the existing
ros/jupyter/torch pattern) rather than a core dependency, since
mvtbtool is an opt-in interactive shell.

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

Copy link
Copy Markdown

Up to standards ✅

🟢 Issues 0 issues

Results:
0 new issues

View in Codacy

🟢 Metrics 0 complexity · 0 duplication

Metric Results
Complexity 0
Duplication 0

View in Codacy

NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.

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