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

Add option to silence messsage for Python 2.7 deprecation #6673

Closed
pradyunsg opened this issue Jul 2, 2019 · 9 comments
Closed

Add option to silence messsage for Python 2.7 deprecation #6673

pradyunsg opened this issue Jul 2, 2019 · 9 comments
Labels
auto-locked Outdated issues that have been locked by automation help wanted For requesting inputs from other members of the community type: feature request Request for a new feature

Comments

@pradyunsg
Copy link
Member

What's the problem this feature will solve?
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).

See #6231 for context.

Describe the solution you'd like
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.

Alternative Solutions

Additional context

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.

@pradyunsg pradyunsg added type: feature request Request for a new feature help wanted For requesting inputs from other members of the community labels Jul 2, 2019
@AdaBehan
Copy link
Contributor

AdaBehan commented Jul 3, 2019

In src/pip/_internal/cli/base_command.py There are three deprecation warnings should we enable silencing all of the or just the 2.7 warning ?

3.4:

"Python 3.4 support has been deprecated. pip 19.1 will be the last one supporting it. Please upgrade your Python as Python 3.4 won't be maintained after March 2019 (cf PEP 429).",

2.7:

"A` future version of pip will drop support for Python 2.7."

2.7 Cpython:

"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. "

@AdaBehan
Copy link
Contributor

AdaBehan commented Jul 3, 2019

We raise an error if the python version has become deprecation i imagine we want to keep this behavior.

# Raise as an error if it has to be removed.
if gone_in is not None and parse(current_version) >= parse(gone_in):
raise PipDeprecationWarning(message)
warnings.warn(message, category=PipDeprecationWarning, stacklevel=2)

@victorvpaulo
Copy link
Contributor

victorvpaulo commented Jul 16, 2019

I would like to work on this.
Really seems like a good way to start contributing to pip development.

@pradyunsg
Copy link
Member Author

pradyunsg commented Jul 17, 2019

Just the 2.7 ones. All python-version based deprecation warnings.

We'd want to continue raising an exception in the deprecation helper.

@pradyunsg
Copy link
Member Author

Please feel free to work on this @victorvpaulo or @adamRogerson!

@AdaBehan
Copy link
Contributor

@victorvpaulo I was going to have a wack at this but if you need more time ill hold off.

@victorvpaulo
Copy link
Contributor

victorvpaulo commented Aug 13, 2019

@adamRogerson I have a implementation for this feature almost ready(#6739), but i could use some help.
The implementation is blocked because some tests are failing, and i can't figure out why.
Would you be interested in helping me with that?
Edit: Finally the tests have passed and the PR is ready for review.

@AdaBehan
Copy link
Contributor

@victorvpaulo Nice work :)

@pradyunsg
Copy link
Member Author

Closed by #6739.

@lock lock bot added the auto-locked Outdated issues that have been locked by automation label Mar 10, 2020
@lock lock bot locked as resolved and limited conversation to collaborators Mar 10, 2020
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 help wanted For requesting inputs from other members of the community type: feature request Request for a new feature
Projects
None yet
Development

No branches or pull requests

3 participants