Skip to content

[codex] Modernize README demos and progress ergonomics#317

Merged
wolph merged 6 commits into
developfrom
harden-issue-tests
Jul 6, 2026
Merged

[codex] Modernize README demos and progress ergonomics#317
wolph merged 6 commits into
developfrom
harden-issue-tests

Conversation

@wolph

@wolph wolph commented Jun 22, 2026

Copy link
Copy Markdown
Owner

Summary

  • refresh the README with animated SVG demos and clearer usage examples for labels, totals, live output, and concurrent bars
  • place the exact demo code directly under each animated SVG so the rendered output and source stay paired
  • render README SVG colors from captured ANSI output so percentage/count colors match the library's real terminal gradient
  • show the multiple-bar demo with independently progressing bars instead of synchronized values
  • simplify the unknown-length demo to use a straightforward range loop
  • remove the extra ergonomics SVG section, generated asset, and obsolete GPG release-verification section
  • keep recent log lines visible in the hero SVG while the progress bar advances
  • use branch-relative README SVG links so the PR branch renders its own demo assets
  • add a repeatable README demo renderer plus tests so documented terminal output stays in sync
  • add CLI rate limiting, tighten unit/progress formatting behavior, and harden stream/logging cleanup around failed bars
  • isolate stream cleanup tests so stale redirected-output state does not leak between cases
  • purge docs/superpowers files from the PR branch history

Validation

  • 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.py
  • git diff --check

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread progressbar/widgets.py
Comment thread progressbar/bar.py
Comment thread progressbar/utils.py Outdated
@wolph wolph force-pushed the harden-issue-tests branch from 5fa00aa to bd91a11 Compare June 23, 2026 01:41
@wolph wolph force-pushed the harden-issue-tests branch from 55e4e1a to aab0a08 Compare June 23, 2026 13:17
wolph added 3 commits June 23, 2026 15:33
# 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
Comment thread progressbar/widgets.py
Comment on lines +1344 to +1350
def __init__(
self,
name='postfix',
prefix=' ',
separator=', ',
**kwargs: typing.Any,
):
wolph added 2 commits July 6, 2026 19:48
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.
@wolph wolph marked this pull request as ready for review July 6, 2026 17:59
Copilot AI review requested due to automatic review settings July 6, 2026 17:59
@wolph wolph merged commit 29a4944 into develop Jul 6, 2026
13 checks passed
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, you can upgrade your account or add credits to your account and enable them for code reviews in your settings.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

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.

3 participants