-
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
Warn on Python 2.7 #6147
Warn on Python 2.7 #6147
Conversation
LGTM. Needs some test fixes to cater for the stderr output, though 😉 |
Yea, think I've got that sorted now. |
I'll defer to @pfmoore to merge this in, if he has the time to take a look and confirm he's okay with the language of the message. :) |
Gonna go ahead and merge this in now since @pfmoore already OK'd the message earlier and I haven't changed the messaging at all besides a grammar fix. |
Well worded :) |
Yep, it's fine with me. Sorry, I just left a "LGTM" comment than a formal approval - I should have done the latter. |
Maybe a silly question, but is there an easy way to disable this, other than downgrading pip? I've got cron jobs running that now tell me to upgrade python, which is much more frustrating than it is helpful. |
It uses the Python warnings module, so you can configure it with that, e.g.:
That'll hide any warning generated by the base command module. I'm not entirely opposed to some general way to acknowledge specific deprecation warnings and silence them, if that sounds useful then I'd encourage you to open a ticket. |
There's #6119, which can cover this use case as well. |
Edit: The regex syntax I originally had in the message filter only works when defining filters through the Python API, not from the environment. Checks are also only made against the start of the message, not the whole thing. Accordingly, updated to search for the |
Hey, thanks -- appreciate it.
…On Wed, Jan 23, 2019 at 9:13 AM Donald Stufft ***@***.***> wrote:
It uses the Python warnings module, so you can configure it with that,
e.g.:
$ pip list
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.
Package Version
---------- -------
pip 19.0.1
setuptools 40.6.3
wheel 0.32.3
$ PYTHONWARNINGS=ignore:::pip._internal.cli.base_command pip list
Package Version
---------- -------
pip 19.0.1
setuptools 40.6.3
wheel 0.32.3
That'll hide *any* warning generated by the base command module. I'm not
entirely opposed to some general way to acknowledge specific deprecation
warnings and silence them, if that sounds useful then I'd encourage you to
open a ticket.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#6147 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AAZJHhbHnOpvv77TV-ffQq2iw74T5JSvks5vGG4igaJpZM4aJTWM>
.
|
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
As of pip 19.0, it started printing warnings for Python 2.7, which are treated as errors by Jenkins. I looked briefly in to ignoring or silencing those warnings (see pypa/pip#6147 (comment)), but couldn't configure Jenkins correctly. Thus, I'm going with the downgrade, as was done for #bees in project-icp/bee-pollinator-app#447.
As of pip 19, it prints warnings about Python 2.7 (see pypa/pip#6147) which register as errors in Jenkins, causing builds to fail. We suppress the warnings by declaring this environment variable.
The environment variable that @ncoghlan recommended did not suppress the warning for me. Is there another way to silence this? I run
|
@felker Try double quiet:
(From #6207 (comment)) |
@hugovk thanks, I will use this for now. But doesn't it silence all warnings? Weird that the environment variable didn't work for me... |
@felker Yes. There are three levels of silencing, it'll silence everything at the first two levels. |
@felker - The environment variable that @ncoghlan recommended also did not work for me. Here's what is currently working for me (pip 19.0.3):
The second component of the ignore spec is the prefix of the message that is being displayed. The current message is this:
|
@kylegibson You're right, I didn't test mine, and it was broken twice over (regex filters aren't accepted via the environment variable, and filters have to match the start of the message, not an arbitrary subsequence) |
I'm going to go ahead and lock this PR. We have a place for discussion about Python 2.7 at #6231. |
Ref: #6148