Pip: The warning message for Python 2.7 EOL is shown even for Pythons that are not EOL'ing

Created on 27 Jan 2019  ·  10Comments  ·  Source: pypa/pip

Environment

  • pip version: 19.0.1
  • Python version: pypy 6.0.0
  • OS: macOS

PyPy is not EOL'ing on January 1, 2020, but the warning message emitted claims it is.

Description
Not sure how much fixing this matters -- I'm not sure whether there's a clear existing statement or commitment for pip to maintain support for Python2 regardless of CPython (I'd assume from the addition of this warning that there's at least some near-term plan to follow suit).

But as is, I've had a few internal developers ask me whether the message was accurate for us, for which I've had to explain it wasn't, so I figured I'd see whether modifying this message matters to anyone else.

Expected behavior
A warning simply about pip's own plans in cases where the interpreter itself is not EOLing

How to Reproduce
Run e.g. pip list under Python 2.7.

Output

⊙  pip list | head -n2                                                                                                                           julian@Air ●
DEPRECATION: Python 2.7 will reach the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 won't be maintained after that date. A future version of pip will drop support for Python 2.7.
auto-locked bug deprecation

Most helpful comment

@xavfernandez Thanks for the workaround, I bet it can prove useful for lots of small projects.

Still, on by projects it is effectely impossible to apply this. For example on OpenStack we have hundreads of job definitions (and multiple CI systems) and even with a lot of inheritance between them we could not be able to obliterate this message.

In addition to this this could pose problem on many places where PYTHONWARNINGS is already defined, for different purposes.

I am afraid that the correct solution for this is to undo the change that adds this "feature".

All 10 comments

(FWIW I've found https://discuss.python.org/t/packaging-and-python-2/662/73 after submitting this, so now I see the "clear statement" is possibly now under discussion :)

@Julian This probably is an oversight and mostly related to the fact that none of the active maintainers uses pypy. As such its support is mostly a best effort. Feel free to open a PR to amend this for pypy, though we may conclude to remove the message altogether judging by the discussion on the discuss.

@gaborbernat there already is one, but yes would love to see the outcome of the discussion -- in the PR, I left in the part of the warning message saying that pip would eventually drop support for Py2 and just removed the part about EOL, though personally pending the outcome of the discussion, I'd love it if the warning was removed entirely on PyPy as long as pip does not actually have concrete plans to remove support for Py2.

Is there a way to permanently disable this (annoying) warning which is polutting the build logs? ... or we should just stop using newer versions of pip to avoid it?

For pip version check we at least had PIP_DISABLE_PIP_VERSION_CHECK to use to diable it but for this one I was not able to find any cli option to diable it.

This gets displayed on each pip call and if you could have lots of them even on a single tox environment, making your build logs like the 🎄

Workaround:

pip -qq install something

(double --quiet) shuts down this message. Which broke my large collection of cram tests, btw…

PYTHONWARNINGS=ignore:Please.upgrade::pip._internal.cli.base_command should do that.
(from https://github.com/pypa/pip/pull/6147#issuecomment-457910432)

Similar to what @xavfernandez suggests, this does the trick for me: PYTHONWARNINGS=ignore:DEPRECATION pip <whatever>

~$ PYTHONWARNINGS=ignore:DEPRECATION pip list
Package                          Version   
-------------------------------- ----------
asn1crypto                       0.24.0

@xavfernandez Thanks for the workaround, I bet it can prove useful for lots of small projects.

Still, on by projects it is effectely impossible to apply this. For example on OpenStack we have hundreads of job definitions (and multiple CI systems) and even with a lot of inheritance between them we could not be able to obliterate this message.

In addition to this this could pose problem on many places where PYTHONWARNINGS is already defined, for different purposes.

I am afraid that the correct solution for this is to undo the change that adds this "feature".

Feel free to contribute a CLI option that disables the Python version based deprecation messaging.

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

Was this page helpful?
0 / 5 - 0 ratings