Skip to content

✨ feat(render): add Rich library support for enhanced tree output#551

Merged
gaborbernat merged 1 commit intotox-dev:mainfrom
gaborbernat:380
Mar 10, 2026
Merged

✨ feat(render): add Rich library support for enhanced tree output#551
gaborbernat merged 1 commit intotox-dev:mainfrom
gaborbernat:380

Conversation

@gaborbernat
Copy link
Member

@gaborbernat gaborbernat commented Mar 9, 2026

This adds Rich library integration as an optional extra, following the same pattern as the existing graphviz support. The new --output rich format provides color-coded components (package names in cyan, versions in green, metadata in yellow), status icons (✓/⚠/✗) for dependency states, and enhanced tree guides. Version highlighting uses red for missing packages, yellow for conflicts, and green for satisfied dependencies.

The implementation remains opt-in via pip install pipdeptree[rich] to avoid bloating the base package. It reuses the existing tree traversal logic and delegates visual formatting to Rich's Tree component.

Closes #380

This adds a new --output rich format that uses the Rich library for enhanced
terminal output with color coding and visual indicators.

The implementation follows the same pattern as graphviz (optional dependency,
opt-in via pip install pipdeptree[rich]). It provides color-coded package
names, versions, and metadata, along with status icons (✓/⚠/✗) for dependency
states and version highlighting based on whether requirements are satisfied.

Added rich to text output formats so warnings display correctly. Updated CLI
help strings to reflect rich format support for --all, --depth, and --license
options.
@gaborbernat gaborbernat merged commit 205cca8 into tox-dev:main Mar 10, 2026
10 checks passed
@kemzeb
Copy link
Collaborator

kemzeb commented Mar 10, 2026

Was messing around with it, looks sweet!!

@gaborbernat
Copy link
Member Author

#552 I merged it to resolve the conflict with this more heavy-hitting PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Is it possible to support rich for listing the tree?

2 participants