From b98dd2d07d0ff3188dfed1ebfec6fe13605e3170 Mon Sep 17 00:00:00 2001 From: Pradyun Gedam <3275593+pradyunsg@users.noreply.github.com> Date: Tue, 25 Aug 2020 20:40:01 +0530 Subject: [PATCH] Merge pull request #8778 from hugovk/deprecate-3.5 Deprecate support for Python 3.5 --- news/8181.removal | 1 + src/pip/_internal/cli/base_command.py | 14 +++++++++++++- tests/conftest.py | 4 ++-- 3 files changed, 16 insertions(+), 3 deletions(-) create mode 100644 news/8181.removal diff --git a/news/8181.removal b/news/8181.removal new file mode 100644 index 000000000..ae6bbe9f8 --- /dev/null +++ b/news/8181.removal @@ -0,0 +1 @@ +Deprecate support for Python 3.5 diff --git a/src/pip/_internal/cli/base_command.py b/src/pip/_internal/cli/base_command.py index c3b6a856b..197400a72 100644 --- a/src/pip/_internal/cli/base_command.py +++ b/src/pip/_internal/cli/base_command.py @@ -158,7 +158,19 @@ class Command(CommandContextMixIn): "1st, 2020. Please upgrade your Python as Python 2.7 " "is no longer maintained. " ) + message - deprecated(message, replacement=None, gone_in=None) + deprecated(message, replacement=None, gone_in="21.0") + + if ( + sys.version_info[:2] == (3, 5) and + not options.no_python_version_warning + ): + message = ( + "Python 3.5 reached the end of its life on September " + "13th, 2020. Please upgrade your Python as Python 3.5 " + "is no longer maintained. pip 21.0 will drop support " + "for Python 3.5 in January 2021." + ) + deprecated(message, replacement=None, gone_in="21.0") # TODO: Try to get these passing down from the command? # without resorting to os.environ to hold these. diff --git a/tests/conftest.py b/tests/conftest.py index 2aab50207..32b6e6926 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -470,8 +470,8 @@ def in_memory_pip(): @pytest.fixture(scope="session") def deprecated_python(): - """Used to indicate whether pip deprecated this python version""" - return sys.version_info[:2] in [(2, 7)] + """Used to indicate whether pip deprecated this Python version""" + return sys.version_info[:2] in [(2, 7), (3, 5)] @pytest.fixture(scope="session")