Giter Site home page Giter Site logo

Comments (10)

vx1920 avatar vx1920 commented on June 2, 2024

Did somebody look into this problem (obsolete warnings during pip list --outdated) ?
Should I create pull request with adding two lines into pip/_internal/commands/list.py to fix it ?

from pip.

pfmoore avatar pfmoore commented on June 2, 2024

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.

from pip.

vx1920 avatar vx1920 commented on June 2, 2024

How to reproduce in almost any platform:
Ensure that numpy is installed. I see most of warnings about numpy,
but some other packages also reported in the warning.

Run following command:
$ python3 -m pip list --outdated --verbose

In Windows 11 with Python 3.11.7 and latest Anaconda
I have numpy version 1.26.4.
I have these messages:

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)
Link requires a different Python (3.11.7 not in: '>=3.7,<3.11'): https://files.pythonhosted.org/packages/5f/d6/ad58ded26556eaeaa8c971e08b6466f17c4ac4d786cd3d800e26ce59cc01/numpy-1.21.3.zip (from https://pypi.org/simple/numpy/) (requires-python:>=3.7,<3.11)
Link requires a different Python (3.11.7 not in: '>=3.7,<3.11'): https://files.pythonhosted.org/packages/fb/48/b0708ebd7718a8933f0d3937513ef8ef2f4f04529f1f66ca86d873043921/numpy-1.21.4.zip (from https://pypi.org/simple/numpy/) (requires-python:>=3.7,<3.11)
Link requires a different Python (3.11.7 not in: '>=3.7,<3.11'): https://files.pythonhosted.org/packages/c2/a8/a924a09492bdfee8c2ec3094d0a13f2799800b4fdc9c890738aeeb12c72e/numpy-1.21.5.zip (from https://pypi.org/simple/numpy/) (requires-python:>=3.7,<3.11)
Link requires a different Python (3.11.7 not in: '>=3.7,<3.11'): https://files.pythonhosted.org/packages/45/b7/de7b8e67f2232c26af57c205aaad29fe17754f793404f59c8a730c7a191a/numpy-1.21.6.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 ?
Current numpy 1.26.4 do support it, and older (but newer than 1.21) versions did support it.

I am not suggesting new command line option to suppress this warning message.
Option --ignore-requires-python was implemented long ago for "pip install", "pip index" and maybe others.
It means that I am not the only person who thinks that warning is obsolete.
Unfortunately this option was never implemented for "pip list".
It is useful for "pip list --outdated --verbose" and my two lines code change will allow to use this option in "pip list" also. Without it above warning will be shown, as we have it now.

from pip.

pfmoore avatar pfmoore commented on June 2, 2024

Wait, you're complaining about the --verbose output? That's simply intended to give a log of what pip did, it has no bearing on what will be reported as outdated.

Why do I need to care that numpy versions 1.21.1 to 1.21.6 did not support my current Python version ?

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 --verbose flag) that you even saw that information.

You should simply remove the --verbose flag and you'll get the information you need with no unnecessary logging information.

from pip.

vx1920 avatar vx1920 commented on June 2, 2024

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:

  • Useless/obsolete warning already exists.
  • Option to suppress this useless/obsolete warning already exists.
  • If option specified in pip command line - warning should never ever appear, disregard is it pip-install or pip-list or whatever. Everything is already OK with pip-install, but not with pip-list.

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.

from pip.

pfmoore avatar pfmoore commented on June 2, 2024

Sorry, I remain -1 on this. I don't think that having an --ignore-requires-python option on pip list --outdated makes sense. The way you describe it, it would do nothing for anyone who wasn't using --verbose, which would be confusing for users. However, in fact I suspect1 that it would actually give misleading (and arguably incorrect) results. If foo 1.0 works on Python >=3.9, and foo 2.0 works on Python >= 3.12, and the user is running Python 3.10 and has foo 1.0 installed, pip list --outdated --ignore-requires-python would report foo as out of date, even though there is no version of foo that could be installed and work in that environment. Yes, it's "what the user asked" but it's not useful information.

--ignore-requires-python is intended for use when staging files for a different Python installation, and as such is expected to be used with --prefix or --root. pip list doesn't support those options, so it shouldn't support --ignore-requires-python either.

Footnotes

  1. I haven't checked the code.

from pip.

vx1920 avatar vx1920 commented on June 2, 2024

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 ?
Option --verbose adds desired column, but it also enables bunch of obsolete warnings and it is what I don't want to see.

from pip.

pfmoore avatar pfmoore commented on June 2, 2024

Right now, by running pip list --outdated and piping that into a script that adds the location via something like importlib.metadata. You don't actually need pip to tell you that information.

from pip.

vx1920 avatar vx1920 commented on June 2, 2024

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.
Currently you have default output list format as of "--format=columns". What about new "--format=columnsp". It will add package location column same way as it done by --verbose mode, but without enabling useless and misleading warnings as --verbose does.
Should I create pull request for pin/.../list.py to implement of new format for pip-list:
$ python -m pip list --outdated --format=columnsp
It will add column with package location without involving option --verbose, so no more useless/misleading warnings and respective option --ignore-requires-python no more needed also. All previously existed options going to work exactly as before.

from pip.

vx1920 avatar vx1920 commented on June 2, 2024

Should I create pull request with extended columns format in pip list ?
(enable it without --verbose option, but with new format code)

from pip.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.