Commit 5a3489b
committed
feat: v0.4.0 — defork progress/bar.py to codechu-meter + codechu-fmt
ProgressBar's three inline helpers (_RateEstimator, _fmt_duration,
_fmt_rate) duplicated what codechu-meter and codechu-fmt already
provide. With codechu-fmt v0.4.0 exposing integer_seconds,
precision='auto', and bare_items, the inline versions can go.
- progress/bar.py: import RateEstimator from codechu_meter and
format_duration / format_rate from codechu_fmt. Call sites:
eta_str = format_duration(eta_s, integer_seconds=True)
elapsed = format_duration(elapsed, integer_seconds=True)
rate_str = format_rate(rate, unit=..., precision="auto", bare_items=False)
~19 lines net smaller.
- pyproject.toml: new required dependencies
codechu-fmt>=0.4,<0.5
codechu-meter>=0.3,<0.4
Both pure-stdlib, no transitive deps.
- description trimmed: dropped "stdlib-only" since cli now pulls
two tiny Codechu siblings.
- Output regression noted in CHANGELOG: very long ETAs now show as
"1h Xm" instead of "61m 40s" (was a quirk of the forked helper;
hour expansion is the family-wide convention).
182/182 tests pass.1 parent 1c50d8f commit 5a3489b
4 files changed
Lines changed: 37 additions & 56 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
7 | 24 | | |
8 | 25 | | |
9 | 26 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
7 | | - | |
8 | | - | |
| 7 | + | |
| 8 | + | |
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
| |||
25 | 25 | | |
26 | 26 | | |
27 | 27 | | |
28 | | - | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
29 | 32 | | |
30 | 33 | | |
31 | 34 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
30 | 30 | | |
31 | 31 | | |
32 | 32 | | |
33 | | - | |
| 33 | + | |
34 | 34 | | |
35 | 35 | | |
36 | 36 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
7 | | - | |
8 | 7 | | |
9 | 8 | | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
10 | 12 | | |
11 | 13 | | |
12 | 14 | | |
13 | 15 | | |
14 | 16 | | |
15 | 17 | | |
16 | | - | |
17 | | - | |
18 | | - | |
19 | | - | |
20 | | - | |
21 | | - | |
22 | | - | |
23 | | - | |
24 | | - | |
25 | | - | |
26 | | - | |
27 | | - | |
28 | | - | |
29 | | - | |
30 | | - | |
31 | | - | |
32 | | - | |
33 | | - | |
34 | | - | |
35 | | - | |
36 | | - | |
37 | | - | |
38 | | - | |
39 | | - | |
40 | | - | |
41 | | - | |
42 | | - | |
43 | | - | |
44 | | - | |
45 | | - | |
46 | | - | |
47 | | - | |
48 | | - | |
49 | | - | |
50 | | - | |
51 | | - | |
52 | | - | |
53 | | - | |
54 | | - | |
55 | | - | |
56 | | - | |
57 | | - | |
58 | | - | |
59 | | - | |
60 | | - | |
61 | | - | |
62 | 18 | | |
63 | 19 | | |
64 | 20 | | |
| |||
114 | 70 | | |
115 | 71 | | |
116 | 72 | | |
117 | | - | |
| 73 | + | |
118 | 74 | | |
119 | 75 | | |
120 | 76 | | |
| |||
336 | 292 | | |
337 | 293 | | |
338 | 294 | | |
339 | | - | |
| 295 | + | |
340 | 296 | | |
341 | 297 | | |
342 | 298 | | |
| |||
347 | 303 | | |
348 | 304 | | |
349 | 305 | | |
350 | | - | |
| 306 | + | |
351 | 307 | | |
352 | 308 | | |
353 | 309 | | |
| |||
359 | 315 | | |
360 | 316 | | |
361 | 317 | | |
362 | | - | |
| 318 | + | |
| 319 | + | |
| 320 | + | |
| 321 | + | |
| 322 | + | |
| 323 | + | |
363 | 324 | | |
364 | 325 | | |
365 | 326 | | |
366 | 327 | | |
367 | 328 | | |
368 | 329 | | |
369 | 330 | | |
370 | | - | |
| 331 | + | |
371 | 332 | | |
372 | 333 | | |
373 | 334 | | |
| |||
0 commit comments