-
Notifications
You must be signed in to change notification settings - Fork 3k
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
Add install option to hide "Requirement already satisfied" log info. #5900
Comments
Regarding consistency, the problem with |
It seems like a more scalable approach would be for pip to let one pass one or more "ids" of messages to suppress (like how Django, flake, etc. operate). Then there wouldn't need to be a separate flag for each message (of which there can be very many). Also, allowing message ids would make it easier to support suppressing many different messages without having to open a separate PR for each one. |
I like @cjerdonek's suggestion here. It's definitely more scalable and makes more sense to allow. |
I like the proposed approach too. I did not look into pip before, but indeed the "already met" messages are coming from a The idea of having a keyword-code for each type of output and being able to disable one or many in a single command line argument seems to resolve most of the use cases I guess, and we could even suppress the |
a temporary solution could be: pip install -r requirements.txt | grep -v 'already satisfied' works really well for me |
My pip install -r requirements.txt command is in a Makefile but is followed by && so the "| grep -v already" breaks the &&. |
I think you could do |
I removed the "discussion needed" label as I think we agree the right way to fix this is to address: #6119 Rather than closing as a duplicate, I'll leave this open for easier discoverability and since there's not much harm. |
The solution to the above seems to be the following: |
Original solution from here pypa/pip#5900 (comment)
This option would also be useful in Jupyter notebooks to prevent cluttering output cells when running something like |
These messages are so annoying and cause unnecessary resource usage. |
You can also get the 'pip ...' part's exit status in bash thanks to the PIPESTATUS array, but it's not POSIX.
It avoids having to change the pipefail option; Obviously, I'm in favour of a feature flag such as the one OP suggested. |
What's the problem this feature will solve?
I'm running
pip install -r requirements.txt
at each deployment to keep my third-parties up to date with the code. With several dozens of requirements, the log is pretty big, while I don't really care to know that 99 % of the libs was "already satisfied" from one deployment to the next one. The worst is sub-dependencies are also shown, so in fact I can get up to 200 lines displayed...Most of the execution trace is:
Describe the solution you'd like
I would like to be able to hide those warnings with a simple command argument. For example:
Alternative Solutions
It seems that
-q
is doing the job, but it is hiding in fact all log message at INFO level, so new installations get hidden too... I still want to monitor that so I can log any environment changes from my deployment log.For now, the only viable solution is to use standard UNIX tools, and exclude those lines with
grep
: https://stackoverflow.com/questions/36350951/hide-requirement-already-satisfied-warning It does work, but it could be better :)Additional context
The name
--no-warn-already-satisfied
would be consistent with other options that already exists inpip install
arguments, such asno-warn-conflicts
andno-warn-script-location
The text was updated successfully, but these errors were encountered: