Using a click.progressbar with:
update_min_steps which isn't a divisor of length
show_pos=True
won't show full completion at the end. This can be reproduced as follows:
import time
import click
with click.progressbar(
range(20),
show_pos=True,
update_min_steps=7,
) as bar:
for i in bar:
time.sleep(0.1)
with (final) output in the terminal
[####################################] 14/20
Expected behaviour: I had expected the output to show 20/20 at the end.
This would be consistent with the default percentage formatting, as can be seen by commenting the line show_pos=True and re-running the reproduction:
[####################################] 100%
Environment:
- Python version: tested with 3.12.3 and 3.14.3
- Click version: 8.4.1
Using a
click.progressbarwith:update_min_stepswhich isn't a divisor oflengthshow_pos=Truewon't show full completion at the end. This can be reproduced as follows:
with (final) output in the terminal
Expected behaviour: I had expected the output to show
20/20at the end.This would be consistent with the default percentage formatting, as can be seen by commenting the line
show_pos=Trueand re-running the reproduction:Environment: