-
Notifications
You must be signed in to change notification settings - Fork 3.1k
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
Additional colums in pip list --format=columns can be enabled by --verbose only with useless warnings #12540
Comments
Did somebody look into this problem (obsolete warnings during pip list --outdated) ? |
Please provide a reproducible example of how you would get into a situation where this warning is issued, but it isn't useful (and hence the proposed option would be appropriate). The various examples you mention in the "additional context" section don't explain how the situation arises, or why things are actually not something the user should worry about. |
How to reproduce in almost any platform: Run following command: In Windows 11 with Python 3.11.7 and latest Anaconda Link requires a different Python (3.11.7 not in: '>=3.7,<3.11'): https://files.pythonhosted.org/packages/3a/be/650f9c091ef71cb01d735775d554e068752d3ff63d7943b26316dc401749/numpy-1.21.2.zip (from https://pypi.org/simple/numpy/) (requires-python:>=3.7,<3.11) Why do I need to care that numpy versions 1.21.1 to 1.21.6 did not support my current Python version ? I am not suggesting new command line option to suppress this warning message. |
Wait, you're complaining about the
You don't. It's only because you asked for a log of how pip worked out whether the version you have is outdated (by using the You should simply remove the |
I do need to use --verbose flag in pip-list on Linux, because I want to see where --outdated package is installed and I don't want to see this annoing/misleading/useless warning message about about very old versions of some packages. I am trying to avoid updating packages installed by system: if if Linux is OK with older version - I don't need latest verion in my local folder. Option --ignore-requires-python to suppress this mostly useless and misleading warning message already exists and it works with pip-install and others and it works mostly in --verbose mode. My suggestion is fixing small inconsistence of pip in general, so you no more need to answer questions "why this option works with install and does not work with list". Everything should be consistent:
If somebody was allowed to implement above warning suppression during install (even with real risk of inconsistent package version installed) - it is much safer to allow suppression in pip-list (it is read-only operation). Actually it can be even better to suppress this warning completely and unconditionally for pip-list, but this code change will never ever be approved. My suggestion is to keep default behaviour and allow to use existed option to suppress useless warning not only in pip-install, but also in pip-list. |
Sorry, I remain -1 on this. I don't think that having an
Footnotes
|
I want just following: pip list --outdated with additional column showing package location, but without useless warnings. How can it be achieved in good way ? |
Right now, by running |
Why I don't need pip to tell me about package location if pip already can do it with --verbose option (unfortunately in combination with useless warnings). Now I begin to understand that above --verbose option is doing too many things at once and it is not good. I believe that --verbose should be mostly about warning/trace messages, but add/don't add column with package location is about output format in pip-list. |
Should I create pull request with extended columns format in pip list ? |
What's the problem this feature will solve?
It looks like option was implemented for pip-install, but never for pip-list. Attempt to use it with pip-list gives an error, maybe it is not a bug, but feature...
Option is useful when we run 'pip list --outdated --verbose'. In this case we may have bunch of messages 'Link requires a different Python', all about very old versions of some packages (like numpy version 1.21.nn). These old versions of packages really do not support new Python 3.11, but it is totally useless information in most of cases. I have Python 3.11 and current numpy-1.26.4 supports current Python 3.11.
I do need pip-list --outdated running with --verbose flag, but I don't want to see these useless warning messages.
Describe the solution you'd like
Problem can be solved by adding option --ignore-requires-python to pip-list.
Two lines with ignore_requires_python can be added to pip/_internal/commands/list.py.
New line at the beginning of the function ListCommand.add_options():
def add_options(self) -> None:
self.cmd_opts.add_option(cmdoptions.ignore_requires_python())
.......
In the ListCommand._build_package_builder(), call to SelectionPreferences,
additional optional parameter:
# Pass allow_yanked=False to ignore yanked versions.
selection_prefs = SelectionPreferences(
allow_yanked=False,
allow_all_prereleases=options.pre,
ignore_requires_python = options.ignore_requires_python,
)
............
Alternative Solutions
Another approach can be to modify pip_internal\index\package_finder.py: if we are looking for package update - do not care about all versions older than currently installed version of particular package. It can make it work faster. I have no idea how to do it, it looks too smart for me. Probably it is better don't even try to modify package_finder.py (at least for me).
Additional context
Number of these warnings depends upon environment. Latest Windows+Anaconda gives bunch of such messages. Most of Linux also (Debian, Garuda, Ubuntu). No any messages from Zorin OS. Packages with messages: numpy, shiboken, pikepdf and others. Maybe some repositories just do not keep very old versions...
Code of Conduct
The text was updated successfully, but these errors were encountered: