feat(setup): improve demon-setup terminal UX with downstream-safe color#290
Open
viborc wants to merge 1 commit into
Open
feat(setup): improve demon-setup terminal UX with downstream-safe color#290viborc wants to merge 1 commit into
viborc wants to merge 1 commit into
Conversation
Add a tiny stdlib styler (acestep/ui.py) and use it to colorize the human-facing output of demon-setup and the TensorRT build matrix: green status ([ok]), yellow/red warn/fail, light-orange phase banners and titles, green summary labels, and a blue/yellow launch block. Plain color over the existing text - no structural or wording changes. Color is emitted ONLY when the target stream is an interactive TTY. The gate is pure sys.stdout.isatty(), with NO_COLOR / TERM=dumb honored and intentionally no FORCE_COLOR override. On any pipe, file, or captured subprocess - i.e. every test and every downstream consumer - the gate is off and style() returns its input unchanged, so emitted bytes are byte-identical to before. SGR codes are ASCII-only (no encoding risk); no text, labels, or phase numbers are altered. No new dependency (stdlib os/sys only). obs.py structured logs and build_report.csv are untouched. Verified: the three setup/build unit tests pass unchanged, and a piped byte-diff against pre-change output is identical (apart from the live 'disk: NNN GB free' number).
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
acestep/ui.py) and uses it to colorize the human-facing output ofdemon-setupand the TensorRT build matrix: green[ok]status, yellow/red warn/fail, light-orange phase banners and titles, green summary labels, and a blue/yellow launch block.Downstream-safe by construction
sys.stdout.isatty()gate, withNO_COLOR/TERM=dumbhonored and intentionally noFORCE_COLORoverride.style()returns its input unchanged, so emitted bytes are byte-identical to before. SGR codes are ASCII-only (no encoding risk); no text, labels, or phase numbers are altered.os/sysonly).obs.pystructured logs andbuild_report.csvare untouched.Checks
pytest tests/unit/test_build_preset.py tests/unit/test_setup_starter_loras.py tests/unit/test_onnx_staleness.py-> 13 passed, unchanged (no test edits).demon-setup, build--dry-run) vs pre-change output: identical, apart from the livedisk: NNN GB freenumber.