Skip to content

Commit

Permalink
Only show Python 2.7 EOL date on CPython.
Browse files Browse the repository at this point in the history
Other Python implementations, notably PyPy, are not EOL'ing on January
1, 2020.
  • Loading branch information
Julian committed Jan 31, 2019
1 parent e5f4bbb commit 77c989f
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 7 deletions.
2 changes: 2 additions & 0 deletions news/6207.bugfix
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
The Python 2 end of life warning now only shows on CPython, which is the
implementation that has announced end of life plans.
17 changes: 10 additions & 7 deletions src/pip/_internal/cli/base_command.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import logging.config
import optparse
import os
import platform
import sys
import traceback

Expand Down Expand Up @@ -145,14 +146,16 @@ def main(self, args):
gone_in='19.2',
)
elif sys.version_info[:2] == (2, 7):
deprecated(
"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.",
replacement=None,
gone_in=None,
message = (
"A future version of pip will drop support for Python 2.7."
)
if platform.python_implementation() == "CPython":
message = (
"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. "
) + message
deprecated(message, replacement=None, gone_in=None)

# TODO: Try to get these passing down from the command?
# without resorting to os.environ to hold these.
Expand Down

0 comments on commit 77c989f

Please sign in to comment.