Skip to content

Fix progress bar remaining time calculation - #544

Open
lprnmns wants to merge 2 commits into
python-poetry:mainfrom
lprnmns:fix/progress-bar-remaining-time
Open

Fix progress bar remaining time calculation#544
lprnmns wants to merge 2 commits into
python-poetry:mainfrom
lprnmns:fix/progress-bar-remaining-time

Conversation

@lprnmns

@lprnmns lprnmns commented Aug 31, 2026

Copy link
Copy Markdown

Problem

The custom ProgressBar remaining-time placeholder always reports less than one second after progress begins. For a bar with 10 total steps, 2 completed steps, and 10 seconds elapsed, it reports "< 1 sec" even though 40 seconds remain.

Fix

Use the number of uncompleted steps when estimating the remaining time. This makes remaining equal to estimated completion time minus elapsed time.

Tests

  • poetry run pytest tests/ui/test_progress_bar.py -k remaining - passed (1 passed, 25 deselected)
  • poetry run pytest - passed (248 passed, 3 skipped)
  • poetry run pre-commit run --all-files - passed
  • poetry run mypy - passed
  • towncrier check --compare-with origin/main - passed

Compatibility

This changes only the documented custom remaining-time calculation. The normal and verbose built-in formats do not use the remaining placeholder.

Related issue

Independent reproduction; no matching open issue or pull request was found.

The required news/544.bugfix.md fragment is included.

@lprnmns
lprnmns marked this pull request as ready for review August 31, 2026 12:22
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.

1 participant