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

Comments

@pradyunsg
Copy link
Member

@pradyunsg pradyunsg commented Jul 2, 2019

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

  • Maintain status quo
  • Piggy back on #6119

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.

@adamRogerson

This comment has been minimized.

Copy link
Contributor

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

@adamRogerson

This comment has been minimized.

Copy link
Contributor

@adamRogerson adamRogerson 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

This comment has been minimized.

Copy link
Contributor

@victorvpaulo 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

This comment has been minimized.

Copy link
Member Author

@pradyunsg 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

This comment has been minimized.

Copy link
Member Author

@pradyunsg pradyunsg commented Jul 17, 2019

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

@adamRogerson

This comment has been minimized.

Copy link
Contributor

@adamRogerson adamRogerson commented Aug 13, 2019

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

@victorvpaulo

This comment has been minimized.

Copy link
Contributor

@victorvpaulo 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.

@adamRogerson

This comment has been minimized.

Copy link
Contributor

@adamRogerson adamRogerson commented Aug 14, 2019

@victorvpaulo Nice work :)

@pradyunsg

This comment has been minimized.

Copy link
Member Author

@pradyunsg pradyunsg commented Feb 2, 2020

Closed by #6739.

@pradyunsg pradyunsg closed this Feb 2, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
3 participants
You can’t perform that action at this time.