Skip to content

Commit

Permalink
Warn on Python 2.7
Browse files Browse the repository at this point in the history
  • Loading branch information
dstufft committed Jan 19, 2019
1 parent 0637aad commit 71dbc9c
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
2 changes: 2 additions & 0 deletions news/6148.removal
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Start printing a warning for Python 2.7 to warn of impending Python 2.7 End-of-life and
prompt users to start migrating to Python 3.
8 changes: 8 additions & 0 deletions src/pip/_internal/cli/base_command.py
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,14 @@ def main(self, args):
replacement=None,
gone_in='19.2',
)
elif sys.version_info[:2] == (2, 7):
deprecated(
"Python 2.7 will reach the end of it's 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,
)

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

0 comments on commit 71dbc9c

Please sign in to comment.