david got a fish trophy!
Add rich to RBTools and replace old modules.
Review Request #15151 — Created July 3, 2026 and updated
This change adds the
richlibrary as a dependency, and creates the
basic framework for rich output. This is based on a combination of
Christian and my previous attempts at this work.This creates a new RBToolsConsole which wraps two rich
Consoleobjects
for stdout and stderr. This also includes a few helpers for multi-step
operations, some basic status levels, progress, spinners, and table
output. This console is first created in a command's__init__, but
will get recreated after we parse command-line options in order to
properly support the new--color=[auto,always,never]option.When commands are running in JSON output mode, a handler is pushed onto
the console that suppresses output. This allows commands to do what
they've always done: unconditionally write to both stdout/stderr and the
json output object, and whichever one is expected to run will work. The
existing output wrappers have also been updated to write through the
console object, so that can take advantage of the same suppression
method.All uses of the old
colorama,tqdm, andtexttablelibraries have
been replaced with the new rich output, but I've held off on other
output prettification for a separate change.
- Ran unit tests.
- Tested the various values of the
--coloroption, theCOLOR_MODE
config key, and theNO_COLORandFORCE_COLORenvironment variables. - Tested rich output for the
info,install,post, andstatus
commands.
- Commits:
-
Summary ID kmrpxswxxprsrnyspyktlqwrrvwoxzuw kmrpxswxxprsrnyspyktlqwrrvwoxzuw