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

Adjust Python 2.7 EOL message #6231

Closed
cjerdonek opened this issue Feb 2, 2019 · 17 comments
Closed

Adjust Python 2.7 EOL message #6231

cjerdonek opened this issue Feb 2, 2019 · 17 comments
Assignees
Labels
auto-locked Outdated issues that have been locked by automation type: deprecation Related to deprecation / removal.

Comments

@cjerdonek
Copy link
Member

I'm inclined to add an option and suggest in the message how to suppress the message itself, using pip config.

@pradyunsg Is it okay to discuss this in a separate issue / PR so this can be merged?

Originally posted by @cjerdonek in #6208 (comment)

@cjerdonek cjerdonek added the type: deprecation Related to deprecation / removal. label Feb 3, 2019
@defjaf
Copy link

defjaf commented Feb 4, 2019

So, how do we suppress the 2.7 deprecation message with pip config?

@cjerdonek
Copy link
Member Author

@pradyunsg I think this should go in the next release in some form — unless you’re planning another patch release not long after. My concern is that if the message is too annoying without an easy way to suppress, it could dissuade people from using this version of pip. I admit though I haven’t checked to see in what circumstances (e.g. which commands) the message currently displays.

@defjaf I’m pretty sure there’s not currently a way to do it with pip config, which is why he said “add an option” in the original comment above.

@pradyunsg
Copy link
Member

pradyunsg commented Feb 4, 2019

I admit though I haven’t checked to see in what circumstances (e.g. which commands) the message currently displays.

All invocations on Python 2.7.

I think this should go in the next release in some form — unless you’re planning another patch release not long after.

I am not warm to the idea of making a 19.0 series release, post 19.0.2.

If someone is willing to write a PR to suppress python-version related deprecation warnings in pip, I'm OK to get them in the next release but I won't block 19.0.2 on it. If it misses that window, this would have to wait till 19.1, which will be in April.

@xavfernandez
Copy link
Member

#6126 might provide this

@nigels-com
Copy link

nigels-com commented Feb 25, 2019

Some context from the coal face:

I have some C/C++ code using Conan to build with dependencies on various libraries.
I had a hard time making Conan happy on Raspberry Pi due to ARM and limited memory.
Having pip warn me about "end of days" and giving me no practical reason to wrangle Python 3 onto the device is not useful or valuable in this context.
Especially the 27th time than Conan failed to build something.

Overall the experience decreased my confidence in both Conan and Python/Pip suitability for the task.
It works on Linux. It works on Mac. But will it work in 2020? Maybe the font will be red and language will be scarier sounding? What is the point of that?

In other words: I suggest to simply remove the message. It's simply not actionable from my point of view, Python 2.7 will continue to need pip, regardless of 2020.

@cjerdonek
Copy link
Member Author

Additional discussion on this issue occurred here: https://discuss.python.org/t/pip-19-0-is-now-available/757

@pradyunsg
Copy link
Member

pradyunsg commented Feb 25, 2019

@nigels-com I've modified your message to have a slightly milder tone, to avoid it contributing to potentially burning out contributors and other maintainers of pip.

If you don't find that edit appropriate, please free free to ping me anywhere other than on this issue (like my username @gmail.com or on twitter by the same username or in a new issue on this repo).

@nigels-com
Copy link

@pradyunsg I'm supportive of your effort to keep things mild. We in 2.7 land just want to get on with things without undue or unintended friction.

@pradyunsg
Copy link
Member

Personally, I think anyone who wants to help "get this fixed" is welcome to help us take #6126 forward, which is a long term fix for this issue and related issues.

That would provide a mechanism to users who don't care about certain kinds of messages to silence them while allowing the maintainers to provide useful hints to users who might not know as much.

If you care about silencing the Python 2.7 depreciation message, you should also be willing to set certain configuration options to disable such messages. #6126 is the mechanism to suppress such messages.

So, no, I'm personally not amicable to removing this message. I am amicable to providing a decent mechanism to hide this error message and genuinely prefer a general mechanism for filtering messages from within pip.

@pradyunsg
Copy link
Member

Thanks!

We in 2.7 land just want to get on with things without undue or unintended friction.

I understand and empathize. I don't disagree with your requirement -- we should provide you a mechanism to silence that message. I don't think removing it for everyone is the right way to do it. :)

@pradyunsg
Copy link
Member

pradyunsg commented Feb 25, 2019

FWIW, you can suppress that message today with an environment variable:

PYTHONWARNINGS=ignore:Please.upgrade::pip._internal.cli.base_command

(From #6147)

PYTHONWARNINGS=ignore:DEPRECATION::pip._internal.cli.base_command

@nigels-com
Copy link

An opt-out policy is a step in the right direction. Appreciated.

@ncoghlan

This comment has been minimized.

@pradyunsg

This comment has been minimized.

@pradyunsg
Copy link
Member

I think we can break this issue into 2 smaller issues, each of which can be worked on independently:

These would both be good first issues for first time contributors. If no one voices any concerns, I'm going to do this and close this issue sometime in the next 24 hours.

self-notes, in case we break it up

hello there, if you're reading this, please let me know if there are any improvements I can make to the issue descriptions below.


There is a feature request to be able to silence Python version related warnings that pip emits (try running pip 19 on Python 2.7 to see what that means).

The way we want to handle this request is to add a new flag/command line option, similar to --no-warn-script-location to pip, in pip._internal.cli.cmdoptions.general_group (as named in code) and using that within pip's BaseCommand class for putting the version-based checking under a conditional.

Additional references:

This is a moderately complex issue that can serve as starting point for anyone who wants to help out with pip's development -- the process of fixing this should be a good introduction to pip's development workflow.


The error message that pip prints when run on Python 2.7 is not very informative about what timeline pip would use before dropping support or how it might approach it.

@drvink
Copy link

drvink commented Jul 1, 2019

Click to see rant (hidden by maintainers)

I can't wait to still be dealing with The Python Every Non-Trivial Software System Having Made The Mistake Uses vs. The Python They Want You To Use in 2030 (as if ANSI-decorated messages will have had any effect to the contrary).

Anyway, there is a cleaner alternative to setting the PYTHONWARNINGS environment variable in order to silence this, as long as user site customization has not been disabled:

import os, site
if site.ENABLE_USER_SITE: os.path.join(site.getusersitepackages(), 'usercustomize.py')
# -> '/home/mdl/.local/lib/python2.7/site-packages/usercustomize.py'

Hooray. Now squirt this into that file:

try:
    import warnings
    warnings.filterwarnings('ignore', 'DEPRECATION',
                            module='pip._internal.cli.base_command')
except ImportError: pass

Ride the snake.

references: #6147, #6207, #6208, #6231

@pradyunsg
Copy link
Member

pradyunsg commented Jul 2, 2019

next 24 hours.

lol me.

Closing this in favor of #6673 and #6674.

@lock lock bot added the auto-locked Outdated issues that have been locked by automation label Aug 1, 2019
@lock lock bot locked as resolved and limited conversation to collaborators Aug 1, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
auto-locked Outdated issues that have been locked by automation type: deprecation Related to deprecation / removal.
Projects
None yet
Development

No branches or pull requests

7 participants