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 1/4] 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 00000000000..ae6bbe9f88a --- /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 c3b6a856be4..197400a72c5 100644 --- a/src/pip/_internal/cli/base_command.py +++ b/src/pip/_internal/cli/base_command.py @@ -158,7 +158,19 @@ def _main(self, args): "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 2aab50207be..32b6e692610 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") From d8f0a7b6936ec04b549e9ca5ad797a84f1a87146 Mon Sep 17 00:00:00 2001 From: Pradyun Gedam <3275593+pradyunsg@users.noreply.github.com> Date: Tue, 25 Aug 2020 20:40:27 +0530 Subject: [PATCH 2/4] Merge pull request #8752 from sbidoul/imp-8369-deprecation-sbi --- news/8752.feature | 3 +++ src/pip/_internal/commands/install.py | 21 +++------------------ src/pip/_internal/req/req_install.py | 13 +++++++++++++ 3 files changed, 19 insertions(+), 18 deletions(-) create mode 100644 news/8752.feature diff --git a/news/8752.feature b/news/8752.feature new file mode 100644 index 00000000000..d2560da1803 --- /dev/null +++ b/news/8752.feature @@ -0,0 +1,3 @@ +Make the ``setup.py install`` deprecation warning less noisy. We warn only +when ``setup.py install`` succeeded and ``setup.py bdist_wheel`` failed, as +situations where both fails are most probably irrelevant to this deprecation. diff --git a/src/pip/_internal/commands/install.py b/src/pip/_internal/commands/install.py index 8c2c32fd43f..704e2d65666 100644 --- a/src/pip/_internal/commands/install.py +++ b/src/pip/_internal/commands/install.py @@ -22,7 +22,6 @@ from pip._internal.req import install_given_reqs from pip._internal.req.req_tracker import get_requirement_tracker from pip._internal.utils.datetime import today_is_later_than -from pip._internal.utils.deprecation import deprecated from pip._internal.utils.distutils_args import parse_distutils_args from pip._internal.utils.filesystem import test_writable_dir from pip._internal.utils.misc import ( @@ -372,23 +371,9 @@ def run(self, options, args): # For now, we just warn about failures building legacy # requirements, as we'll fall through to a direct # install for those. - legacy_build_failure_names = [ - r.name # type: ignore - for r in build_failures if not r.use_pep517 - ] # type: List[str] - if legacy_build_failure_names: - deprecated( - reason=( - "Could not build wheels for {} which do not use " - "PEP 517. pip will fall back to legacy 'setup.py " - "install' for these.".format( - ", ".join(legacy_build_failure_names) - ) - ), - replacement="to fix the wheel build issue reported above", - gone_in="21.0", - issue=8368, - ) + for r in build_failures: + if not r.use_pep517: + r.legacy_install_reason = 8368 to_install = resolver.get_installation_order( requirement_set diff --git a/src/pip/_internal/req/req_install.py b/src/pip/_internal/req/req_install.py index 4759f4af6f0..f25cec96ae2 100644 --- a/src/pip/_internal/req/req_install.py +++ b/src/pip/_internal/req/req_install.py @@ -121,6 +121,7 @@ def __init__( self.comes_from = comes_from self.constraint = constraint self.editable = editable + self.legacy_install_reason = None # type: Optional[int] # source_dir is the local directory where the linked requirement is # located, or unpacked. In case unpacking is needed, creating and @@ -859,6 +860,18 @@ def install( self.install_succeeded = success + if success and self.legacy_install_reason == 8368: + deprecated( + reason=( + "{} was installed using the legacy 'setup.py install' " + "method, because a wheel could not be built for it.". + format(self.name) + ), + replacement="to fix the wheel build issue reported above", + gone_in="21.0", + issue=8368, + ) + def check_invalid_constraint_type(req): # type: (InstallRequirement) -> str From 8c2102a310372dea70f12e9581b334783441bcea Mon Sep 17 00:00:00 2001 From: Pradyun Gedam Date: Tue, 8 Sep 2020 16:43:34 +0530 Subject: [PATCH 3/4] Bump for release --- NEWS.rst | 16 ++++++++++++++++ news/8181.removal | 1 - news/8752.feature | 3 --- src/pip/__init__.py | 2 +- 4 files changed, 17 insertions(+), 5 deletions(-) delete mode 100644 news/8181.removal delete mode 100644 news/8752.feature diff --git a/NEWS.rst b/NEWS.rst index a0376a06f07..6f7c2cd232f 100644 --- a/NEWS.rst +++ b/NEWS.rst @@ -9,6 +9,22 @@ .. towncrier release notes start +20.2.3 (2020-09-08) +=================== + +Deprecations and Removals +------------------------- + +- Deprecate support for Python 3.5 (`#8181 `_) + +Features +-------- + +- Make the ``setup.py install`` deprecation warning less noisy. We warn only + when ``setup.py install`` succeeded and ``setup.py bdist_wheel`` failed, as + situations where both fails are most probably irrelevant to this deprecation. (`#8752 `_) + + 20.2.2 (2020-08-11) =================== diff --git a/news/8181.removal b/news/8181.removal deleted file mode 100644 index ae6bbe9f88a..00000000000 --- a/news/8181.removal +++ /dev/null @@ -1 +0,0 @@ -Deprecate support for Python 3.5 diff --git a/news/8752.feature b/news/8752.feature deleted file mode 100644 index d2560da1803..00000000000 --- a/news/8752.feature +++ /dev/null @@ -1,3 +0,0 @@ -Make the ``setup.py install`` deprecation warning less noisy. We warn only -when ``setup.py install`` succeeded and ``setup.py bdist_wheel`` failed, as -situations where both fails are most probably irrelevant to this deprecation. diff --git a/src/pip/__init__.py b/src/pip/__init__.py index 611753fedec..9fb68d40354 100644 --- a/src/pip/__init__.py +++ b/src/pip/__init__.py @@ -4,7 +4,7 @@ from typing import List, Optional -__version__ = "20.2.2" +__version__ = "20.2.3" def main(args=None): From e3015eb3a51b84a63d946784e8a0b03283106df5 Mon Sep 17 00:00:00 2001 From: Pradyun Gedam Date: Tue, 8 Sep 2020 16:43:35 +0530 Subject: [PATCH 4/4] Bump for development --- src/pip/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pip/__init__.py b/src/pip/__init__.py index 9fb68d40354..5a2f3c31745 100644 --- a/src/pip/__init__.py +++ b/src/pip/__init__.py @@ -4,7 +4,7 @@ from typing import List, Optional -__version__ = "20.2.3" +__version__ = "20.3.dev0" def main(args=None):