[codex] Modernize README demos and progress ergonomics#317
Conversation
There was a problem hiding this comment.
Code Review
This pull request modernizes the progressbar2 library by introducing tqdm-style ergonomic options (such as desc, total, unit, unit_scale, and postfix), adding new Postfix and UnitProgress widgets, and improving print/log coexistence with a reversible logging stream wrapper. It also updates the CLI to support rate limiting and custom display flags, rewrites the README to be demo-led, and adds a script to generate SVG terminal demos. The review feedback identifies three key improvement opportunities: ensuring valid falsy values (like 0 or False) are not omitted in the Postfix widget, wrapping ProgressBarBase.finish in contextlib.suppress during error handling to prevent masking exceptions, and copying logger.handlers to a tuple during iteration to avoid concurrent modification errors.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
5fa00aa to
bd91a11
Compare
55e4e1a to
aab0a08
Compare
# Conflicts: # README.rst # docs/examples.rst # progressbar/__init__.py # progressbar/__main__.py # progressbar/bar.py # progressbar/multi.py # progressbar/shortcuts.py # progressbar/utils.py
Re-applies the tqdm-compat ergonomics (desc/total/unit/unit_scale/ postfix), the Postfix/UnitProgress widgets, the logging-handler stream wrapping, the CLI flag wiring, and the README/demo modernization on top of the six merged audit PRs: - the new constructor params resolve inside the refactored helper-based __init__ (total/desc fold into the deprecated-alias step; unit and postfix state feed the widget/variable seeding helpers) - the progressbar() shortcut keeps its fast-path dispatch: desc and total render fine on the fast formatter, units and postfixes force the full widget bar - start()/finish() keep the cooperative super() dispatch while restoring this branch's robustness semantics (failed start cannot leak stream-wrapping state; a failing final render still unwinds) - the lazy __init__ registers the new widgets in all three synced export structures (drift-test enforced); API snapshot regenerated for the purely additive widening - the orphaned _resolve_* helpers superseded by the audit's structure are dropped
| def __init__( | ||
| self, | ||
| name='postfix', | ||
| prefix=' ', | ||
| separator=', ', | ||
| **kwargs: typing.Any, | ||
| ): |
On Windows runners color detection reports the WINDOWS level, whose color path is a no-op, so the truecolor escapes this test asserts were never emitted (first catch by the new windows CI job).
capture_demo renders each demo in a subprocess, so the previous in-process COLOR_SUPPORT patch never reached it; on Windows the child's detection reports the WINDOWS level whose color path is a no-op, so the asserted escapes genuinely are not produced there. The README demos are generated on posix.
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
Summary
docs/superpowersfiles from the PR branch historyValidation
python scripts/render_readme_demos.py --check.tox/py313/bin/python -m pytest tests/test_readme_demos.py -q --no-cov.tox/py313/bin/python -m pytest -q --no-cov.tox/py313/bin/pyright.tox/ruff/bin/ruff check scripts/render_readme_demos.py tests/test_readme_demos.py.tox/ruff/bin/ruff format --check scripts/render_readme_demos.py tests/test_readme_demos.pygit diff --check