Skip to content

pip 25.1: installation progress bar in CI is a bit verbose #13354

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
1 task done
AA-Turner opened this issue Apr 27, 2025 · 10 comments
Open
1 task done

pip 25.1: installation progress bar in CI is a bit verbose #13354

AA-Turner opened this issue Apr 27, 2025 · 10 comments
Assignees
Labels
C: output Related to what pip prints type: bug A confirmed bug or unintended behavior

Comments

@AA-Turner
Copy link
Contributor

Description

Opening for discussion, arguably not a bug.

Previous output:

Installing collected packages: snowballstemmer, urllib3, typing_extensions, sphinxcontrib-serializinghtml, sphinxcontrib-qthelp, sphinxcontrib-jsmath, sphinxcontrib-htmlhelp, sphinxcontrib-devhelp, sphinxcontrib-applehelp, roman-numerals-py, Pygments, psutil, pluggy, packaging, MarkupSafe, iniconfig, imagesize, idna, execnet, docutils, defusedxml, cython, charset-normalizer, certifi, babel, alabaster, requests, pytest, Jinja2, Sphinx, pytest-xdist
Successfully installed Jinja2-3.1.6 MarkupSafe-3.0.2 Pygments-2.19.1 Sphinx-8.3.0 alabaster-1.0.0 babel-2.17.0 certifi-2025.1.31 charset-normalizer-3.4.1 cython-3.0.12 defusedxml-0.7.1 docutils-0.21.2 execnet-2.1.1 idna-3.10 imagesize-1.4.1 iniconfig-2.1.0 packaging-25.0 pluggy-1.5.0 psutil-7.0.0 pytest-8.3.5 pytest-xdist-3.6.1 requests-2.32.3 roman-numerals-py-3.1.0 snowballstemmer-2.2.0 sphinxcontrib-applehelp-2.0.0 sphinxcontrib-devhelp-2.0.0 sphinxcontrib-htmlhelp-2.1.0 sphinxcontrib-jsmath-1.0.1 sphinxcontrib-qthelp-2.0.0 sphinxcontrib-serializinghtml-2.0.0 typing_extensions-4.13.2 urllib3-2.4.0

New output:

Installing collected packages: snowballstemmer, urllib3, typing_extensions, sphinxcontrib-serializinghtml, sphinxcontrib-qthelp, sphinxcontrib-jsmath, sphinxcontrib-htmlhelp, sphinxcontrib-devhelp, sphinxcontrib-applehelp, roman-numerals-py, Pygments, psutil, pluggy, packaging, MarkupSafe, iniconfig, imagesize, idna, execnet, docutils, defusedxml, cython, charset-normalizer, certifi, babel, alabaster, requests, pytest, Jinja2, Sphinx, pytest-xdist
25l
   ━╺━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━  1/31 [urllib3]
   ━━━━━━━╸━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━  6/31 [sphinxcontrib-htmlhelp]
   ━━━━━━━━━━━━╸━━━━━━━━━━━━━━━━━━━━━━━━━━━ 10/31 [Pygments]
   ━━━━━━━━━━━━╸━━━━━━━━━━━━━━━━━━━━━━━━━━━ 10/31 [Pygments]
   ━━━━━━━━━━━━╸━━━━━━━━━━━━━━━━━━━━━━━━━━━ 10/31 [Pygments]
   ━━━━━━━━━━━━╸━━━━━━━━━━━━━━━━━━━━━━━━━━━ 10/31 [Pygments]
   ━━━━━━━━━━━━━━╺━━━━━━━━━━━━━━━━━━━━━━━━━ 11/31 [psutil]
   ━━━━━━━━━━━━━━━━━━━━━╸━━━━━━━━━━━━━━━━━━ 17/31 [idna]
   ━━━━━━━━━━━━━━━━━━━━━━━━╸━━━━━━━━━━━━━━━ 19/31 [docutils]
   ━━━━━━━━━━━━━━━━━━━━━━━━╸━━━━━━━━━━━━━━━ 19/31 [docutils]
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━╺━━━━━━━━━━━━ 21/31 [cython]
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━╺━━━━━━━━━━━━ 21/31 [cython]
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━╺━━━━━━━━━━━━ 21/31 [cython]
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╸━━━━━━━━━ 24/31 [babel]
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╸━━━━━━━━━ 24/31 [babel]
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╸━━━━━━ 26/31 [requests]
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╸━━━━━ 27/31 [pytest]
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╺━━━ 28/31 [Jinja2]
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╺━━ 29/31 [Sphinx]
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╺━━ 29/31 [Sphinx]
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╺━━ 29/31 [Sphinx]
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╺━━ 29/31 [Sphinx]
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 31/31 [pytest-xdist]
25h
Successfully installed Jinja2-3.1.6 MarkupSafe-3.0.2 Pygments-2.19.1 Sphinx-8.3.0 alabaster-1.0.0 babel-2.17.0 certifi-2025.4.26 charset-normalizer-3.4.1 cython-3.0.12 defusedxml-0.7.1 docutils-0.21.2 execnet-2.1.1 idna-3.10 imagesize-1.4.1 iniconfig-2.1.0 packaging-25.0 pluggy-1.5.0 psutil-7.0.0 pytest-8.3.5 pytest-xdist-3.6.1 requests-2.32.3 roman-numerals-py-3.1.0 snowballstemmer-2.2.0 sphinxcontrib-applehelp-2.0.0 sphinxcontrib-devhelp-2.0.0 sphinxcontrib-htmlhelp-2.1.0 sphinxcontrib-jsmath-1.0.1 sphinxcontrib-qthelp-2.0.0 sphinxcontrib-serializinghtml-2.0.0 typing_extensions-4.13.2 urllib3-2.4.0

Is there a way to detect that pip is running in CI, and change the rendering of the progress bar to take one line? The download progress bars currently do this:

Downloading babel-2.17.0-py3-none-any.whl (10.2 MB)
25l   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 0.0/10.2 MB ? eta -:--:--
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 10.2/10.2 MB 178.1 MB/s eta 0:00:00

The 25l and 25h output also looks suspect, though I'm not as sure here.

A

Expected behavior

No response

pip version

25.1

Python version

3.13, 3.14

OS

Ubuntu 24.04 (GHA)

How to Reproduce

Run pip install with several dependencies in a CI environment.

Output

No response

Code of Conduct

@AA-Turner AA-Turner added S: needs triage Issues/PRs that need to be triaged type: bug A confirmed bug or unintended behavior labels Apr 27, 2025
@AA-Turner AA-Turner changed the title pip 25.1 progress bar in CI is a bit verbose pip 25.1: installation progress bar in CI is a bit verbose Apr 27, 2025
@notatallshaw
Copy link
Member

First, as a workaround, I generally recommend --progress-bar off or setting the env var PIP_PROGRESS_BAR=OFF for CI environments.

Have you ever noticed this same issue with the download progress? I assume it should be the same, but maybe there are differences that increase the chance of the verbosity with the install progress bar.

@AA-Turner
Copy link
Contributor Author

AA-Turner commented Apr 27, 2025

Thanks!

The download bars are currently fine, I mentioned it in the report but it might have been unclear. They still render a progress bar, but don't have the repeated lines:

The download progress bars currently do this:

Downloading babel-2.17.0-py3-none-any.whl (10.2 MB)
25l   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 0.0/10.2 MB ? eta -:--:--
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 10.2/10.2 MB 178.1 MB/s eta 0:00:00

@ichard26 ichard26 added C: output Related to what pip prints and removed S: needs triage Issues/PRs that need to be triaged labels Apr 27, 2025
@ichard26
Copy link
Member

ichard26 commented Apr 27, 2025

I'll note that FORCE_COLOR is being set to true in the workflow shown here (I tried to reproduce this behaviour with torch, but the progress bar didn't even show up). For better or worse, Rich uses FORCE_COLOR which forces rich to enable terminal mode. The section below does describe a potential solution, however. We could set force_interactive=False if pip is running in CI (and maybe FORCE_COLOR). This is a bit janky, but I agree that we should do something to address it.

We already have logic to detect whether pip is running in CI, anyway.

def looks_like_ci() -> bool:
"""
Return whether it looks like pip is running under CI.
"""
# We don't use the method of checking for a tty (e.g. using isatty())
# because some CI systems mimic a tty (e.g. Travis CI). Thus that
# method doesn't provide definitive information in either direction.
return any(name in os.environ for name in CI_ENVIRONMENT_VARIABLES)

Alternatively, if we want to leave a way to forcefully opt INTO progress bars on CI, we could change the default value of --progress-bar to off if we detect we're running in CI.

@notatallshaw
Copy link
Member

The latest version of Rich also implemented a TTY_COMPATIBLE env var: https://github.com/Textualize/rich/releases/tag/v14.0.0

Perhaps setting TTY_COMPATIBLE=0 in CIs would also have the desired effect?

@ichard26 ichard26 self-assigned this Apr 27, 2025
@AA-Turner
Copy link
Contributor Author

We use FORCE_COLOR to make CI output more readable. I hadn't realised Rich used it for more than just enabling colour, that is unfortunate. I'm happy to close this if it's simply an unexpected combination of settings.

A

@ichard26
Copy link
Member

I'd be fine with passing force_interactive=False to our Rich console configuration if we detect we're running in CI AND the FORCE_COLOR envvar is set. This is quite janky, but it should eliminate the verbosity without too many side-effects. I'm a little worried if we outright disable progress bars in CI or disable interactivity under CI, we'll run into too many edge cases.

I'll file a PR tomorrow after some experimentation.

@pfmoore
Copy link
Member

pfmoore commented Apr 28, 2025

My feeling is that this is a non-urgent fix, meaning that I’m inclined to say I’d include it in 25.1.1 if we need a bugfix release, but I wouldn’t ship 25.1.1 just because of this.

@pfmoore pfmoore closed this as completed Apr 28, 2025
@pfmoore pfmoore reopened this Apr 28, 2025
@pfmoore
Copy link
Member

pfmoore commented Apr 28, 2025

Stupid tablet, caused me to hit the wrong button.

As I was saying, @AA-Turner would you agree with that?

@AA-Turner
Copy link
Contributor Author

Sounds good, definitely not urgent.

A

1 similar comment
@AA-Turner
Copy link
Contributor Author

Sounds good, definitely not urgent.

A

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C: output Related to what pip prints type: bug A confirmed bug or unintended behavior
Projects
None yet
Development

No branches or pull requests

4 participants