← Back to Pull requests

Hide download speed after completion #14319

Closed
nikolas-sapa closed this pull request without merging on Oct 17, 2026 13:16 UTC
View on GitHub
nikolas-sapa nikolas-sapa commented on Sep 18, 2026 15:11 UTC
Author

What does this PR do?

Fixes #10633. Rich keeps rendering the last sampled transfer speed after a download finishes, which is often unrepresentative. The speed column is now removed once the download iterable is exhausted, so completed downloads show size and elapsed time only. Interrupted downloads keep the speed column.

PR Checklist:


  • I agree to follow the PSF Code of Conduct.

  • I have read and have followed the CONTRIBUTING.md file.

  • I have added a news file fragment (or this PR does not need one).

  • I have read and followed the AI_POLICY.md file, and if any AI tools were used, I have disclosed it below.

  • Assisted-by: Muse Spark

    Diff: 73 lines (+73 / -0) across 3 files Reviewer: sepehr-rs Review duration: 41645m
    All Vouch review confidence checks passed
    Residual risk 0.05 = Change Risk (0.32) × (1 − Review Confidence (0.84)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.32 · 73 lines diff across 3 files
    0.32
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.77 · 5 substantive comment(s)
    0.77
    Model 3 · Review Timing & Attention
    Session adequacy: 100% · Reviewer familiarity: 35%
    84%
    Bedrock Claude 3 · Risk Narration
    (disconnected)
    Groq
    Groq Risk Narration
    AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
    Model 1 · Change Risk Attribution
    SHAP Weights
    Diff Size diff_size
    0.258
    Real PR Conversation Timeline
    8 items
    sepehr-rs sepehr-rs commented on code on Sep 23, 2026 11:00 UTC
    Code Review
    tests/unit/test_progress_bars.py:1
    @@ -0,0 +1,72 @@
    +from __future__ import annotations
    +
    +from collections.abc import Iterator
    +from functools import partial
    +from io import StringIO
    +from itertools import count
    +from unittest.mock import patch
    +
    +import pytest
    +
    +from pip._vendor.rich.console import Console
    +
    +from pip._internal.cli import progress_bars
    +
    +
    +@pytest.mark.parametrize("size", [100, None, 0])
    +@pytest.mark.parametrize("initial_progress", [None, 20])

    Why are we parametrizing initial_progress here? It only affects the pre-loop advance call, not the post-loop column-filtering logic this test is actually checking.
    I'd suggest removing it, and also narrowing size to [100, None] like the second test (0 and None hit the same if not size branch, so 0 doesn't test anything extra).

    sepehr-rs sepehr-rs requested changes on Sep 23, 2026 11:05 UTC
    Changes Requested Reviewer

    Hi @nikolas-sapa, thanks for your contribution!
    The speed/ETA is correctly hidden when the download finishes:

    Downloading openai-3.19.0-py3-none-any.whl (2.1 MB)
       ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 2.1/2.1 MB  0:00:01
    Installing collected packages: openai
    

    I've left an inline comment on the tests. Please take a look and let me know if you need any help addressing it!

    nikolas-sapa nikolas-sapa commented on Sep 26, 2026 15:01 UTC
    Author

    Done in d0b2b80f5 — dropped the initial_progress parametrization and narrowed size to [100, None] as suggested. Thanks!

    nikolas-sapa nikolas-sapa commented on Oct 03, 2026 10:13 UTC
    Author

    @sepehr-rs — both suggestions are in d0b2b80f5: the initial_progress parametrization is gone, and size is narrowed to [100, None]. You're right that 0 added nothing — progress_bars.py:41 is if not size:, so 0 and None take the same branch.

    Worth noting on my own verification: I confirmed the test can actually fail rather than just passing. Dropping the TransferSpeedColumn filter turns both test_speed_hidden_after_download_finishes cases red on assert "/s" not in rendered, with 600 bytes/s still in the output.

    One caveat on that local run, so it isn't over-read: I had to bypass tests/conftest.py because installer and pytest-socket aren't present in my environment, so it was not a full-fidelity pip test run. The GitHub CI on the branch is the real signal, and it is green.

    I've left the branch un-rebased. It is 4 commits behind main, but only for the platformdirs vendor bump (#14303) and the build lock (#14311), which touch none of this PR's files — so a rebase would be churn on the review rather than a cleaner diff. Happy to rebase if you'd rather read it against tip.

    No rush on your side — just flagging that the review has been outstanding for a few days.

    nikolas-sapa nikolas-sapa commented on Oct 06, 2026 05:13 UTC
    Author

    @sepehr-rs — gentle bump, both points have been addressed since 2026-09-26 and there has been no activity on the review since 2026-09-23.

    For reference, the current head is still d0b2b80f5: the initial_progress parametrization is gone and size is narrowed to [100, None]. I also confirmed the test can genuinely fail — dropping the TransferSpeedColumn filter turns both test_speed_hidden_after_download_finishes cases red on assert "/s" not in rendered, with 600 bytes/s in the output.

    Branch is deliberately un-rebased. It is 4 commits behind main, but only via the platformdirs vendor bump (#14303) and build lock (#14311), which touch none of this PR's files — a rebase would be churn on your review rather than a cleaner diff. Happy to do it if you prefer reading against tip.

    If the change is not what you had in mind for either point, say so and I will rework it rather than re-review as-is.

    sepehr-rs sepehr-rs commented on Oct 06, 2026 13:16 UTC
    Contributor

    Hi, please stop mentioning me on this, especially since it’s only been 3 days since your last message. This only creates unnecessary spam and adds noise for others watching the repository. Furthermore, all of your messages come across as AI-generated, which makes this even more unpleasant.

    pradyunsg pradyunsg commented on Oct 17, 2026 13:16 UTC
    Contributor

    The numbers on https://agentscan.tools/user/nikolas-sapa suggests this is very much an autonomous LLM agent rather than a human doing things.

    I'm gonna close this out -- @nikolas-sapa if you aren't using an LLM fully autonomously, let us know. And, if the account is being automated, please let us know as well.

    Reviewers
    Assignees
    nikolas-sapa nikolas-sapa
    Labels
    risk: low confidence: 84.3% reviewed
    Vouch Risk Breakdown
    AI-powered review risk analysis
    Change Risk
    Change Risk · Model 1 (XGBoost)
    Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
    Score: 31.7% (LOW) · Higher = larger blast radius
    31.7%
    Review Confidence
    Review Confidence · Models 2 & 3
    Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
    Score: 84.3% · Lower = rushed or shallow review
    84.3%
    Residual Risk
    Residual Risk · Core Equation
    Residual = Change × (1 − Confidence)
    Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
    Score: 5.0% · Safe to merge
    5.0%
    Repository