Skip to content
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

--no-color not respected by download progress bar output #11045

Open
1 task done
matsaman opened this issue Apr 19, 2022 · 4 comments · May be fixed by #11048
Open
1 task done

--no-color not respected by download progress bar output #11045

matsaman opened this issue Apr 19, 2022 · 4 comments · May be fixed by #11048
Labels
C: output Related to what pip prints type: bug A confirmed bug or unintended behavior

Comments

@matsaman
Copy link

Description

--no-color not respected by download progress bar output

Expected behavior

No response

pip version

22.0.4

Python version

3.9.12

OS

macOS

How to Reproduce

pip install numpy --no-cache-dir --no-color, for example, produces color.

Output

No response

Code of Conduct

@matsaman matsaman added S: needs triage Issues/PRs that need to be triaged type: bug A confirmed bug or unintended behavior labels Apr 19, 2022
@q0w
Copy link
Contributor

q0w commented Apr 19, 2022

what about adding no_color flag to _rich_progress_bar and rich.reconfigure console?

@matsaman
Copy link
Author

matsaman commented Apr 19, 2022

NO_COLOR=foo pip install numpy --no-cache-dir does disable the color, therefore it does appear to be Rich at issue as you've suspected. Ideally I'd say we'd want to control its color output through the existing --no-color option.

@q0w
Copy link
Contributor

q0w commented Apr 19, 2022

The problem is here

progress = Progress(*columns, refresh_per_second=30)

and rich.get_console() returns new console instance. Maybe move rich.Console initialization somewhere outside setup_logging?

@q0w q0w linked a pull request Apr 19, 2022 that will close this issue
@gdlmx
Copy link

gdlmx commented Mar 18, 2023

After almost one year, this issue is still not fixed. A workaround is using the NO_COLOR environment variable, which inject the setting into rich.console.Console.

@ichard26 ichard26 added C: output Related to what pip prints and removed S: needs triage Issues/PRs that need to be triaged labels Apr 22, 2024
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

Successfully merging a pull request may close this issue.

4 participants