RRick van Hattemfix(widgets): restore the Bar fill's default gradient
| 文件 | 最后提交记录 | 最后更新时间 |
|---|---|---|
docs(readme): benchmark-race hero, animated demos, Markdown conversion Rewrite the README as Markdown with a measured-data wow layout and wire up the assets and gates that keep it honest: - README.md replaces README.rst: centered badge row, animated benchmark race hero, feature sections with animated SVG demos (colors, logs, multibar, parallel execution, pv-style CLI), verified stability numbers, retained reference content - benchmarks: measure plain progressbar2 and progressbar2[fast] separately in scenarios A and C, add speedups to requirements, refresh results/report/chart against current develop - scripts/render_race.py: deterministic race SVG generated from results.json, byte-drift gated in tox docs-demos next to render_demos --check - new registry demos readme/colors, readme/parallel and readme/cli with capture tests, README code blocks test-synced to the example sources - render_demos: drop rows that MultiBar clears so removed bars no longer linger as stale duplicate frames - fix(bar): NullBar.finish() now flips _finished, so a NullBar inside a MultiBar context cannot hang the exit wait (regression test included) - tox: new readme env builds the sdist and runs twine check --strict (with readme_renderer[md]) in CI | 20 天前 | |
feat: parallel execution verbs with reliable progress bars (#327) * feat(parallel): shared plumbing for the parallel verbs * feat(parallel): display layer with keep-alive plain display * feat(parallel): MultiBar-backed per-task display * feat(parallel): sync engine and ordered map over threads * feat(parallel): pin error, timeout and interrupt contracts * test(parallel): process and interpreter pools with auto-chunking * feat(parallel): lazy ordered imap and completion-order imap_unordered * feat(parallel): starmap, tqdm-style aliases and as_completed * feat(parallel): reusable Pool layer * feat(parallel): asyncio engine and amap * feat(parallel): aimap, gather drop-in and AsyncPool * feat(parallel): run() shell helper * feat(parallel): @parallel decorator * feat(parallel): public API exports * docs(parallel): howto, reference and README section * test(parallel): close coverage gaps to 100% branch * fix(ci): version-gate coverage, subinterpreter pickling and Windows argv quoting * test(perf): guard import laziness and parallel coordinator scaling * fix(lint): parenthesize the laziness probe for ISC004 (ruff 0.16) | 20 天前 | |
refactor(types): add missing hot-path and public annotations widgets.py: annotate string_or_lambda/create_marker/create_wrapper, _calculate_eta (ETA/AbsoluteETA), AnimatedMarker.__init__, Bar-family __call__ color: bool, and SamplesMixin.samples (timedelta | int, per its docstring). multi.py: return annotations on __setitem__/__getitem__/stop/ get_sorted_bars/__enter__. utils.py: AttributeDict __getattr__/__setattr__ -> Any, and typed WrappingIO/StreamWrapper listeners as set[ProgressBarMixinBase] (matches start_capturing's parameter type). conftest.py: fixture annotations. Drop the now-obsolete SamplesMixin pyright ignore in tests. Annotation-only. | 1 个月前 | |
more ruff fixes | 1 年前 | |
refactored requirements | 9 年前 | |
Fix MultiBar thread-state, lifecycle and widget math bugs multi.py: per-instance locks/events (D1), start() clears instead of sets the closed event (D6), __exit__ stops on exception instead of hanging (D4), flush() resets the buffer position to avoid NUL output (D3), append_label works together with prepend_label (D7), snapshot iteration for cross-thread dict mutation (D2), join(timeout) keeps the thread reference while alive (D8). bar.py: days_elapsed uses the full elapsed time (A1), init() resets the finished/started flags and finish() is idempotent so the global capturing counter stays balanced (A2), f-string in the unknown variable error (A3), __del__ suppresses all exceptions (A4), SIGWINCH handling moved to a shared registry so overlapping bars restore the original handler in any finish order (A5). widgets.py/algorithms.py: ETA and fill computations respect min_value (B3, B9), JobStatusBar drops old markers instead of overflowing (B4), MultiProgressBar treats a zero total as no progress (B5), transfer speed shows the regular format before any data (B6), time-window samples evict on time alone (B7), EMA/DEMA seed from the first value (B8). Legacy tests updated for the corrected semantics. | 2 个月前 | |
test: harden MRO module check against non-string __module__ | 1 个月前 | |
Greatly improved type hints and fixed automatic testing pipeline | 1 年前 | |
fix(widgets): restore the Bar fill's default gradient Bar declared fg=colors.gradient and bg=None as plain class attributes that nothing reads: the color machinery only consults _gradient_colors, which stayed all-None, so the default bar fill rendered colorless on every terminal while Percentage and SimpleProgress (via ColoredMixin) colored correctly. The fill now sweeps the red to green gradient with progress, as the dead attributes always intended. Fallout handled with it: - render_demos: classify progress lines against SGR-stripped text. PERCENT_RE finds no word boundary in '...39m100%' and BAR_RE cannot match a fill with color codes woven through it, so the colored 100% finish line misclassified as log output and the log-window demos never showed their bars completing. - tests: same stripping for the BAR_RE-based assertions, a regression test for the gradient default, and a colors-opted-out test keeping the no-colors branch covered. - 35 demo SVGs re-rendered with the gradient fill, and the benchmark race's plain progressbar2 lane now colors its fill the same way the real default does. | 20 天前 | |
fix(widgets): keep class-level mapping defaults in FormatCustomText dict(mapping or {}) discarded class-level mapping defaults declared by subclasses. Fall back to the class attribute when no mapping is passed, still copying so instance mutation never touches the shared default. | 1 个月前 | |
Greatly improved type hints and fixed automatic testing pipeline | 1 年前 | |
Add failing regression tests for audited bugs Covers lifecycle (A), widget math (B), streams/terminal/env (C), MultiBar concurrency (D) and CLI/platform (E) findings. All tests currently fail against the buggy behavior; fixes follow per subsystem. | 2 个月前 | |
Greatly improved type hints and fixed automatic testing pipeline | 1 年前 | |
docs: rebuild the documentation as an interactive Diataxis site Tutorial, how-to, reference and explanation sections with tested, runnable demos: SVG animations rendered from real bar output and an in-browser Pyodide console (vendored xterm.js, wheels built at docs build time) covered by a playwright smoke-test suite. LaTeX/PDF/ePub builds stay green under fail_on_warning. | 22 天前 | |
Greatly improved type hints and fixed automatic testing pipeline | 1 年前 | |
Greatly improved type hints and fixed automatic testing pipeline | 1 年前 | |
fix(env): narrow terminal-detection exception handlers is_ansi_terminal wrapped fd.isatty() probing in contextlib.suppress(Exception) and is_terminal in a bare except Exception, so genuine bugs (unexpected None, wrong types, programming errors) were silently downgraded to "not a terminal". Narrow both to the failures a stream can legitimately raise while probing: OSError (real I/O), ValueError (closed/detached file objects) and AttributeError (objects without isatty). Anything else now propagates. Drop the stale # pragma: no cover on the is_terminal isatty fallback now that tests exercise it. Update the existing test_utils RuntimeError case to OSError (a tolerated error); RuntimeError propagation is covered in the new tests/test_env_detection.py. | 1 个月前 | |
Address issues #212, #295 and lock in #301 - #212: make ProgressBar.__iter__ a generator so abandoning the loop (break or an exception in the loop body) raises GeneratorExit and lets the bar finish and unwrap any redirected stdout/stderr. The dead `except GeneratorExit` branch in __next__ is removed. Iterator usage, context managers and direct next() are unchanged. - #295: add an opt-in `redirect_blank_line` option that keeps a blank line between redirected output and the bar (off by default, so existing output is unchanged). - #301: add a regression test proving that using a bar as both a context manager and an iterable wrapper now renders the bar once (the double-finish guard already fixed it; develop still renders it twice). Adds targeted regression tests for each; suite green at 100% coverage. | 2 个月前 | |
fix(fast): use a 4-char spinner constant instead of a 5-char raw literal r'|/-\\' keeps both backslashes, so the literal was 5 chars and the four-frame cycle depended on a hardcoded `% 4`. Extract a module-level _SPINNER_FRAMES (plain 4-char literal) and index by its length. | 2 个月前 | |
perf(utils): precompile ANSI escape patterns in no_color The bytes CSI pattern was rebuilt on every no_color() call and the str branch relied on re's internal cache; both run per widget per redraw. Compile both variants once at module import and reuse via Pattern.sub(). | 2 个月前 | |
Greatly improved type hints and fixed automatic testing pipeline | 1 年前 | |
feat: parallel execution verbs with reliable progress bars (#327) * feat(parallel): shared plumbing for the parallel verbs * feat(parallel): display layer with keep-alive plain display * feat(parallel): MultiBar-backed per-task display * feat(parallel): sync engine and ordered map over threads * feat(parallel): pin error, timeout and interrupt contracts * test(parallel): process and interpreter pools with auto-chunking * feat(parallel): lazy ordered imap and completion-order imap_unordered * feat(parallel): starmap, tqdm-style aliases and as_completed * feat(parallel): reusable Pool layer * feat(parallel): asyncio engine and amap * feat(parallel): aimap, gather drop-in and AsyncPool * feat(parallel): run() shell helper * feat(parallel): @parallel decorator * feat(parallel): public API exports * docs(parallel): howto, reference and README section * test(parallel): close coverage gaps to 100% branch * fix(ci): version-gate coverage, subinterpreter pickling and Windows argv quoting * test(perf): guard import laziness and parallel coordinator scaling * fix(lint): parenthesize the laziness probe for ISC004 (ruff 0.16) | 20 天前 | |
Greatly improved type hints and fixed automatic testing pipeline | 1 年前 | |
fix(widgets): keep JobStatusBar marker state per-bar in progress.extra A single JobStatusBar reused across two ProgressBars accumulated its marker history on the widget instance, interleaving the two bars' output. Store the marker list in progress.extra under a per-widget key (mirroring SamplesMixin), so the widget stays stateless and reusable. The job_markers attribute is retained for backward compatibility but no longer holds render state. | 2 个月前 | |
Greatly improved type hints and fixed automatic testing pipeline | 1 年前 | |
Greatly improved type hints and fixed automatic testing pipeline | 1 年前 | |
Update legacy tests for corrected double-finish semantics The monitor_progress goldens and the colors test encoded the duplicate final render caused by the double finish() from the iterator plus the context manager; finish() is idempotent now so the bar renders its final state once. The multibar example finishes its bars explicitly since the context manager now genuinely waits for completion. The transfer-speed golden for zero progress uses the regular format. Also: FORCE_COLOR handling returns directly instead of break (avoids an unrecordable coverage arc), SIGWINCH dispatch and reverse-order unwrapping gained coverage, and the repro_bugs.py scratch battery is replaced by the regression tests. | 2 个月前 | |
Merge develop into harden-issue-tests # Conflicts: # README.rst # docs/examples.rst # progressbar/__init__.py # progressbar/__main__.py # progressbar/bar.py # progressbar/multi.py # progressbar/shortcuts.py # progressbar/utils.py | 1 个月前 | |
Add optional native iterator accelerator: ~5 ns/iter, ~4x faster than rich `ProgressBar.__iter__` now dispatches to `speedups.progressbar.FastBarIterator` (the `progressbar2[fast]` extra) when it is importable, falling back to the pure-Python generator otherwise. The native iterator counts items in a C field and only calls back into Python at redraw crossings via a small protocol (`_fast_begin`/`_fast_tick`/`_fast_end`/`_fast_end_dirty`), reusing the existing gate/redraw/calibration machinery so the redraw cadence is identical. The only behavioural difference is that `value`/`previous_value` are synced at crossings rather than every iteration, so reads between redraws lag slightly (like tqdm.n); `PROGRESSBAR_DISABLE_FASTPATH=1` forces the pure-Python path. This makes progressbar2 the fastest progress bar measured: ~5 ns/iter vs rich 19, tqdm 55. Pure Python stays ~30 ns (no native build), still ~1.8x faster than tqdm and 2nd to rich. Also: - hoist `_gate_enabled` to a local in the pure-Python iterator (free, no behaviour change), trimming the fallback hot path a few ns. - conftest `disable_native_accelerator` autouse fixture forces the pure-Python path for the rest of the suite; native behaviour is covered explicitly in tests/test_native_accelerator.py (dispatch + hooks covered without the compiled package via a fake/direct calls, so CI stays at 100% coverage; real end-to-end equivalence + issue #212 break/exception cleanup tests run where speedups is installed). - refresh benchmark artifacts + README performance section. | 2 个月前 | |
test: make API snapshot version-stable; single import style Describe typing aliases, enums (by member list) and stdlib re-exports with version-stable descriptors: typing.Union aliases changed type in 3.14, enum constructor signatures are metaclass artifacts, and TracebackType's signature availability varies. Snapshot regenerated on 3.14 and verified identical on 3.10. Use a single import style for progressbar in the new test modules so CodeQL's import-and-import-from check stays quiet (same alias pattern as test_fast_default.py). | 1 个月前 | |
Add failing regression tests for audited bugs Covers lifecycle (A), widget math (B), streams/terminal/env (C), MultiBar concurrency (D) and CLI/platform (E) findings. All tests currently fail against the buggy behavior; fixes follow per subsystem. | 2 个月前 | |
docs: rebuild the documentation as an interactive Diataxis site Tutorial, how-to, reference and explanation sections with tested, runnable demos: SVG animations rendered from real bar output and an in-browser Pyodide console (vendored xterm.js, wheels built at docs build time) covered by a playwright smoke-test suite. LaTeX/PDF/ePub builds stay green under fail_on_warning. | 22 天前 | |
feat: parallel execution verbs with reliable progress bars (#327) * feat(parallel): shared plumbing for the parallel verbs * feat(parallel): display layer with keep-alive plain display * feat(parallel): MultiBar-backed per-task display * feat(parallel): sync engine and ordered map over threads * feat(parallel): pin error, timeout and interrupt contracts * test(parallel): process and interpreter pools with auto-chunking * feat(parallel): lazy ordered imap and completion-order imap_unordered * feat(parallel): starmap, tqdm-style aliases and as_completed * feat(parallel): reusable Pool layer * feat(parallel): asyncio engine and amap * feat(parallel): aimap, gather drop-in and AsyncPool * feat(parallel): run() shell helper * feat(parallel): @parallel decorator * feat(parallel): public API exports * docs(parallel): howto, reference and README section * test(parallel): close coverage gaps to 100% branch * fix(ci): version-gate coverage, subinterpreter pickling and Windows argv quoting * test(perf): guard import laziness and parallel coordinator scaling * fix(lint): parenthesize the laziness probe for ISC004 (ruff 0.16) | 20 天前 | |
feat: parallel execution verbs with reliable progress bars (#327) * feat(parallel): shared plumbing for the parallel verbs * feat(parallel): display layer with keep-alive plain display * feat(parallel): MultiBar-backed per-task display * feat(parallel): sync engine and ordered map over threads * feat(parallel): pin error, timeout and interrupt contracts * test(parallel): process and interpreter pools with auto-chunking * feat(parallel): lazy ordered imap and completion-order imap_unordered * feat(parallel): starmap, tqdm-style aliases and as_completed * feat(parallel): reusable Pool layer * feat(parallel): asyncio engine and amap * feat(parallel): aimap, gather drop-in and AsyncPool * feat(parallel): run() shell helper * feat(parallel): @parallel decorator * feat(parallel): public API exports * docs(parallel): howto, reference and README section * test(parallel): close coverage gaps to 100% branch * fix(ci): version-gate coverage, subinterpreter pickling and Windows argv quoting * test(perf): guard import laziness and parallel coordinator scaling * fix(lint): parenthesize the laziness probe for ISC004 (ruff 0.16) | 20 天前 | |
feat: parallel execution verbs with reliable progress bars (#327) * feat(parallel): shared plumbing for the parallel verbs * feat(parallel): display layer with keep-alive plain display * feat(parallel): MultiBar-backed per-task display * feat(parallel): sync engine and ordered map over threads * feat(parallel): pin error, timeout and interrupt contracts * test(parallel): process and interpreter pools with auto-chunking * feat(parallel): lazy ordered imap and completion-order imap_unordered * feat(parallel): starmap, tqdm-style aliases and as_completed * feat(parallel): reusable Pool layer * feat(parallel): asyncio engine and amap * feat(parallel): aimap, gather drop-in and AsyncPool * feat(parallel): run() shell helper * feat(parallel): @parallel decorator * feat(parallel): public API exports * docs(parallel): howto, reference and README section * test(parallel): close coverage gaps to 100% branch * fix(ci): version-gate coverage, subinterpreter pickling and Windows argv quoting * test(perf): guard import laziness and parallel coordinator scaling * fix(lint): parenthesize the laziness probe for ISC004 (ruff 0.16) | 20 天前 | |
feat: parallel execution verbs with reliable progress bars (#327) * feat(parallel): shared plumbing for the parallel verbs * feat(parallel): display layer with keep-alive plain display * feat(parallel): MultiBar-backed per-task display * feat(parallel): sync engine and ordered map over threads * feat(parallel): pin error, timeout and interrupt contracts * test(parallel): process and interpreter pools with auto-chunking * feat(parallel): lazy ordered imap and completion-order imap_unordered * feat(parallel): starmap, tqdm-style aliases and as_completed * feat(parallel): reusable Pool layer * feat(parallel): asyncio engine and amap * feat(parallel): aimap, gather drop-in and AsyncPool * feat(parallel): run() shell helper * feat(parallel): @parallel decorator * feat(parallel): public API exports * docs(parallel): howto, reference and README section * test(parallel): close coverage gaps to 100% branch * fix(ci): version-gate coverage, subinterpreter pickling and Windows argv quoting * test(perf): guard import laziness and parallel coordinator scaling * fix(lint): parenthesize the laziness probe for ISC004 (ruff 0.16) | 20 天前 | |
feat: parallel execution verbs with reliable progress bars (#327) * feat(parallel): shared plumbing for the parallel verbs * feat(parallel): display layer with keep-alive plain display * feat(parallel): MultiBar-backed per-task display * feat(parallel): sync engine and ordered map over threads * feat(parallel): pin error, timeout and interrupt contracts * test(parallel): process and interpreter pools with auto-chunking * feat(parallel): lazy ordered imap and completion-order imap_unordered * feat(parallel): starmap, tqdm-style aliases and as_completed * feat(parallel): reusable Pool layer * feat(parallel): asyncio engine and amap * feat(parallel): aimap, gather drop-in and AsyncPool * feat(parallel): run() shell helper * feat(parallel): @parallel decorator * feat(parallel): public API exports * docs(parallel): howto, reference and README section * test(parallel): close coverage gaps to 100% branch * fix(ci): version-gate coverage, subinterpreter pickling and Windows argv quoting * test(perf): guard import laziness and parallel coordinator scaling * fix(lint): parenthesize the laziness probe for ISC004 (ruff 0.16) | 20 天前 | |
feat: parallel execution verbs with reliable progress bars (#327) * feat(parallel): shared plumbing for the parallel verbs * feat(parallel): display layer with keep-alive plain display * feat(parallel): MultiBar-backed per-task display * feat(parallel): sync engine and ordered map over threads * feat(parallel): pin error, timeout and interrupt contracts * test(parallel): process and interpreter pools with auto-chunking * feat(parallel): lazy ordered imap and completion-order imap_unordered * feat(parallel): starmap, tqdm-style aliases and as_completed * feat(parallel): reusable Pool layer * feat(parallel): asyncio engine and amap * feat(parallel): aimap, gather drop-in and AsyncPool * feat(parallel): run() shell helper * feat(parallel): @parallel decorator * feat(parallel): public API exports * docs(parallel): howto, reference and README section * test(parallel): close coverage gaps to 100% branch * fix(ci): version-gate coverage, subinterpreter pickling and Windows argv quoting * test(perf): guard import laziness and parallel coordinator scaling * fix(lint): parenthesize the laziness probe for ISC004 (ruff 0.16) | 20 天前 | |
feat: parallel execution verbs with reliable progress bars (#327) * feat(parallel): shared plumbing for the parallel verbs * feat(parallel): display layer with keep-alive plain display * feat(parallel): MultiBar-backed per-task display * feat(parallel): sync engine and ordered map over threads * feat(parallel): pin error, timeout and interrupt contracts * test(parallel): process and interpreter pools with auto-chunking * feat(parallel): lazy ordered imap and completion-order imap_unordered * feat(parallel): starmap, tqdm-style aliases and as_completed * feat(parallel): reusable Pool layer * feat(parallel): asyncio engine and amap * feat(parallel): aimap, gather drop-in and AsyncPool * feat(parallel): run() shell helper * feat(parallel): @parallel decorator * feat(parallel): public API exports * docs(parallel): howto, reference and README section * test(parallel): close coverage gaps to 100% branch * fix(ci): version-gate coverage, subinterpreter pickling and Windows argv quoting * test(perf): guard import laziness and parallel coordinator scaling * fix(lint): parenthesize the laziness probe for ISC004 (ruff 0.16) | 20 天前 | |
feat: parallel execution verbs with reliable progress bars (#327) * feat(parallel): shared plumbing for the parallel verbs * feat(parallel): display layer with keep-alive plain display * feat(parallel): MultiBar-backed per-task display * feat(parallel): sync engine and ordered map over threads * feat(parallel): pin error, timeout and interrupt contracts * test(parallel): process and interpreter pools with auto-chunking * feat(parallel): lazy ordered imap and completion-order imap_unordered * feat(parallel): starmap, tqdm-style aliases and as_completed * feat(parallel): reusable Pool layer * feat(parallel): asyncio engine and amap * feat(parallel): aimap, gather drop-in and AsyncPool * feat(parallel): run() shell helper * feat(parallel): @parallel decorator * feat(parallel): public API exports * docs(parallel): howto, reference and README section * test(parallel): close coverage gaps to 100% branch * fix(ci): version-gate coverage, subinterpreter pickling and Windows argv quoting * test(perf): guard import laziness and parallel coordinator scaling * fix(lint): parenthesize the laziness probe for ISC004 (ruff 0.16) | 20 天前 | |
feat: parallel execution verbs with reliable progress bars (#327) * feat(parallel): shared plumbing for the parallel verbs * feat(parallel): display layer with keep-alive plain display * feat(parallel): MultiBar-backed per-task display * feat(parallel): sync engine and ordered map over threads * feat(parallel): pin error, timeout and interrupt contracts * test(parallel): process and interpreter pools with auto-chunking * feat(parallel): lazy ordered imap and completion-order imap_unordered * feat(parallel): starmap, tqdm-style aliases and as_completed * feat(parallel): reusable Pool layer * feat(parallel): asyncio engine and amap * feat(parallel): aimap, gather drop-in and AsyncPool * feat(parallel): run() shell helper * feat(parallel): @parallel decorator * feat(parallel): public API exports * docs(parallel): howto, reference and README section * test(parallel): close coverage gaps to 100% branch * fix(ci): version-gate coverage, subinterpreter pickling and Windows argv quoting * test(perf): guard import laziness and parallel coordinator scaling * fix(lint): parenthesize the laziness probe for ISC004 (ruff 0.16) | 20 天前 | |
feat: parallel execution verbs with reliable progress bars (#327) * feat(parallel): shared plumbing for the parallel verbs * feat(parallel): display layer with keep-alive plain display * feat(parallel): MultiBar-backed per-task display * feat(parallel): sync engine and ordered map over threads * feat(parallel): pin error, timeout and interrupt contracts * test(parallel): process and interpreter pools with auto-chunking * feat(parallel): lazy ordered imap and completion-order imap_unordered * feat(parallel): starmap, tqdm-style aliases and as_completed * feat(parallel): reusable Pool layer * feat(parallel): asyncio engine and amap * feat(parallel): aimap, gather drop-in and AsyncPool * feat(parallel): run() shell helper * feat(parallel): @parallel decorator * feat(parallel): public API exports * docs(parallel): howto, reference and README section * test(parallel): close coverage gaps to 100% branch * fix(ci): version-gate coverage, subinterpreter pickling and Windows argv quoting * test(perf): guard import laziness and parallel coordinator scaling * fix(lint): parenthesize the laziness probe for ISC004 (ruff 0.16) | 20 天前 | |
feat: parallel execution verbs with reliable progress bars (#327) * feat(parallel): shared plumbing for the parallel verbs * feat(parallel): display layer with keep-alive plain display * feat(parallel): MultiBar-backed per-task display * feat(parallel): sync engine and ordered map over threads * feat(parallel): pin error, timeout and interrupt contracts * test(parallel): process and interpreter pools with auto-chunking * feat(parallel): lazy ordered imap and completion-order imap_unordered * feat(parallel): starmap, tqdm-style aliases and as_completed * feat(parallel): reusable Pool layer * feat(parallel): asyncio engine and amap * feat(parallel): aimap, gather drop-in and AsyncPool * feat(parallel): run() shell helper * feat(parallel): @parallel decorator * feat(parallel): public API exports * docs(parallel): howto, reference and README section * test(parallel): close coverage gaps to 100% branch * fix(ci): version-gate coverage, subinterpreter pickling and Windows argv quoting * test(perf): guard import laziness and parallel coordinator scaling * fix(lint): parenthesize the laziness probe for ISC004 (ruff 0.16) | 20 天前 | |
feat: parallel execution verbs with reliable progress bars (#327) * feat(parallel): shared plumbing for the parallel verbs * feat(parallel): display layer with keep-alive plain display * feat(parallel): MultiBar-backed per-task display * feat(parallel): sync engine and ordered map over threads * feat(parallel): pin error, timeout and interrupt contracts * test(parallel): process and interpreter pools with auto-chunking * feat(parallel): lazy ordered imap and completion-order imap_unordered * feat(parallel): starmap, tqdm-style aliases and as_completed * feat(parallel): reusable Pool layer * feat(parallel): asyncio engine and amap * feat(parallel): aimap, gather drop-in and AsyncPool * feat(parallel): run() shell helper * feat(parallel): @parallel decorator * feat(parallel): public API exports * docs(parallel): howto, reference and README section * test(parallel): close coverage gaps to 100% branch * fix(ci): version-gate coverage, subinterpreter pickling and Windows argv quoting * test(perf): guard import laziness and parallel coordinator scaling * fix(lint): parenthesize the laziness probe for ISC004 (ruff 0.16) | 20 天前 | |
fix(widgets): restore the Bar fill's default gradient Bar declared fg=colors.gradient and bg=None as plain class attributes that nothing reads: the color machinery only consults _gradient_colors, which stayed all-None, so the default bar fill rendered colorless on every terminal while Percentage and SimpleProgress (via ColoredMixin) colored correctly. The fill now sweeps the red to green gradient with progress, as the dead attributes always intended. Fallout handled with it: - render_demos: classify progress lines against SGR-stripped text. PERCENT_RE finds no word boundary in '...39m100%' and BAR_RE cannot match a fill with color codes woven through it, so the colored 100% finish line misclassified as log output and the log-window demos never showed their bars completing. - tests: same stripping for the BAR_RE-based assertions, a regression test for the gradient default, and a colors-opted-out test keeping the no-colors branch covered. - 35 demo SVGs re-rendered with the gradient fill, and the benchmark race's plain progressbar2 lane now colors its fill the same way the real default does. | 20 天前 | |
Modernize README demos and progress features | 2 个月前 | |
fix(widgets): restore the Bar fill's default gradient Bar declared fg=colors.gradient and bg=None as plain class attributes that nothing reads: the color machinery only consults _gradient_colors, which stayed all-None, so the default bar fill rendered colorless on every terminal while Percentage and SimpleProgress (via ColoredMixin) colored correctly. The fill now sweeps the red to green gradient with progress, as the dead attributes always intended. Fallout handled with it: - render_demos: classify progress lines against SGR-stripped text. PERCENT_RE finds no word boundary in '...39m100%' and BAR_RE cannot match a fill with color codes woven through it, so the colored 100% finish line misclassified as log output and the log-window demos never showed their bars completing. - tests: same stripping for the BAR_RE-based assertions, a regression test for the gradient default, and a colors-opted-out test keeping the no-colors branch covered. - 35 demo SVGs re-rendered with the gradient fill, and the benchmark race's plain progressbar2 lane now colors its fill the same way the real default does. | 20 天前 | |
docs(readme): benchmark-race hero, animated demos, Markdown conversion Rewrite the README as Markdown with a measured-data wow layout and wire up the assets and gates that keep it honest: - README.md replaces README.rst: centered badge row, animated benchmark race hero, feature sections with animated SVG demos (colors, logs, multibar, parallel execution, pv-style CLI), verified stability numbers, retained reference content - benchmarks: measure plain progressbar2 and progressbar2[fast] separately in scenarios A and C, add speedups to requirements, refresh results/report/chart against current develop - scripts/render_race.py: deterministic race SVG generated from results.json, byte-drift gated in tox docs-demos next to render_demos --check - new registry demos readme/colors, readme/parallel and readme/cli with capture tests, README code blocks test-synced to the example sources - render_demos: drop rows that MultiBar clears so removed bars no longer linger as stale duplicate frames - fix(bar): NullBar.finish() now flips _finished, so a NullBar inside a MultiBar context cannot hang the exit wait (regression test included) - tox: new readme env builds the sdist and runs twine check --strict (with readme_renderer[md]) in CI | 20 天前 | |
Add failing regression tests for audited bugs Covers lifecycle (A), widget math (B), streams/terminal/env (C), MultiBar concurrency (D) and CLI/platform (E) findings. All tests currently fail against the buggy behavior; fixes follow per subsystem. | 2 个月前 | |
Update legacy tests for corrected double-finish semantics The monitor_progress goldens and the colors test encoded the duplicate final render caused by the double finish() from the iterator plus the context manager; finish() is idempotent now so the bar renders its final state once. The multibar example finishes its bars explicitly since the context manager now genuinely waits for completion. The transfer-speed golden for zero progress uses the regular format. Also: FORCE_COLOR handling returns directly instead of break (avoids an unrecordable coverage arc), SIGWINCH dispatch and reverse-order unwrapping gained coverage, and the repro_bugs.py scratch battery is replaced by the regression tests. | 2 个月前 | |
fix: keep generic metadata out of AttributeDict mappings | 1 个月前 | |
refactor(types): add missing hot-path and public annotations widgets.py: annotate string_or_lambda/create_marker/create_wrapper, _calculate_eta (ETA/AbsoluteETA), AnimatedMarker.__init__, Bar-family __call__ color: bool, and SamplesMixin.samples (timedelta | int, per its docstring). multi.py: return annotations on __setitem__/__getitem__/stop/ get_sorted_bars/__enter__. utils.py: AttributeDict __getattr__/__setattr__ -> Any, and typed WrappingIO/StreamWrapper listeners as set[ProgressBarMixinBase] (matches start_capturing's parameter type). conftest.py: fixture annotations. Drop the now-obsolete SamplesMixin pyright ignore in tests. Annotation-only. | 1 个月前 | |
test: harden #295 blank-line separator placement | 1 个月前 | |
fix(widgets): treat max_value=None as unknown in ETA guard The explicit UnknownLength check replaced a broad try/except TypeError; None is also a legitimate indeterminate max_value and must take the N/A path (flagged by review on #321). | 1 个月前 | |
Greatly improved type hints and fixed automatic testing pipeline | 1 年前 | |
Greatly improved type hints and fixed automatic testing pipeline | 1 年前 | |
Fix unknown-length redraw and animated marker fill at finish - ProgressBar._needs_update now redraws unknown-length bars on every value change, so a non-time-sensitive widget set (e.g. the format_label example's FormatLabel) animates instead of jumping straight from the start value to the final value. - AnimatedMarker keeps a filled bar full when finished instead of collapsing to a single marker character, fixing the filling_bar_animated_marker and color_bar_animated_marker_example examples emptying out at 100%. - Isolate the SIGWINCH overlapping-bars regression test from global _ResizeRegistry state so the handler-restore branch is exercised deterministically regardless of suite ordering, restoring 100% coverage. Adds targeted regression tests for each. | 2 个月前 | |
test: make API snapshot version-stable; single import style Describe typing aliases, enums (by member list) and stdlib re-exports with version-stable descriptors: typing.Union aliases changed type in 3.14, enum constructor signatures are metaclass artifacts, and TracebackType's signature availability varies. Snapshot regenerated on 3.14 and verified identical on 3.10. Use a single import style for progressbar in the new test modules so CodeQL's import-and-import-from check stays quiet (same alias pattern as test_fast_default.py). | 1 个月前 | |
fix: keep generic metadata out of AttributeDict mappings | 1 个月前 | |
docs: rebuild the documentation as an interactive Diataxis site Tutorial, how-to, reference and explanation sections with tested, runnable demos: SVG animations rendered from real bar output and an in-browser Pyodide console (vendored xterm.js, wheels built at docs build time) covered by a playwright smoke-test suite. LaTeX/PDF/ePub builds stay green under fail_on_warning. | 22 天前 | |
Address review feedback and CI issues Review feedback: - windows.getch() only decodes KEY_EVENT records with bKeyDown set; reading other union members returned garbage for mouse/focus events (Gemini). _valid_handle() normalizes ctypes instances before comparing against INVALID_HANDLE_VALUE (Codex). - _ResizeRegistry checks hasattr(signal, 'SIGWINCH') explicitly instead of relying on suppressed AttributeError (Gemini). - create_marker clamps the fill length to the available width for value > max_value with max_error=False (Gemini). - get_sorted_bars() snapshots the dict values explicitly before sorting (Codex) and MultiBar.flush() keeps the fd write inside the print lock so concurrent output cannot interleave (Codex). - unwrap_stdout/unwrap_stderr reset the wrapper's own stream references so needs_clear()/update_capturing() don't act on a stale WrappingIO (Codex). - CLI line mode opens input and output with newline='' so CRLF files are counted at their true byte size (Codex). CI: - CodeQL: no side effects in assert, no explicit __del__ call (the finalizer test now uses gc + sys.unraisablehook), no ineffectual subscript statements in tests. - The py315 tox job is marked experimental/continue-on-error: Python 3.15 is pre-release and no released typing_extensions survives 'from typing_extensions import *' on it (no_type_check_decorator is still in __all__ after its removal from typing), which breaks the python_utils import chain. Verified against 3.15.0b2 with typing_extensions 4.14.1 and 4.15.0. | 2 个月前 | |
test: harden #301 no-double-render with reporter widget set + generator | 1 个月前 | |
Greatly improved type hints and fixed automatic testing pipeline | 1 年前 |