From 68e22aa9595b80c88ae1a16ae21a1021970a3be3 Mon Sep 17 00:00:00 2001 From: Pradyun Gedam Date: Fri, 8 Oct 2021 12:22:15 +0100 Subject: [PATCH] Un-deprecate source distribution re-installation behaviour This will be handled as part of a broader effort to make the reinstall behaviours more ergonomic and easier to reason about. --- news/8711.removal.rst | 1 + .../resolution/resolvelib/resolver.py | 21 ------------------- tests/functional/test_new_resolver.py | 1 - 3 files changed, 1 insertion(+), 22 deletions(-) create mode 100644 news/8711.removal.rst diff --git a/news/8711.removal.rst b/news/8711.removal.rst new file mode 100644 index 00000000000..80423aa4259 --- /dev/null +++ b/news/8711.removal.rst @@ -0,0 +1 @@ +Un-deprecate source distribution re-installation behaviour. diff --git a/src/pip/_internal/resolution/resolvelib/resolver.py b/src/pip/_internal/resolution/resolvelib/resolver.py index f89afaf433c..12f96702024 100644 --- a/src/pip/_internal/resolution/resolvelib/resolver.py +++ b/src/pip/_internal/resolution/resolvelib/resolver.py @@ -19,8 +19,6 @@ PipDebuggingReporter, PipReporter, ) -from pip._internal.utils.deprecation import deprecated -from pip._internal.utils.filetypes import is_archive_file from .base import Candidate, Requirement from .factory import Factory @@ -136,25 +134,6 @@ def resolve( ) continue - looks_like_sdist = ( - is_archive_file(candidate.source_link.file_path) - and candidate.source_link.ext != ".zip" - ) - if looks_like_sdist: - # is a local sdist -- show a deprecation warning! - reason = ( - "Source distribution is being reinstalled despite an " - "installed package having the same name and version as " - "the installed package." - ) - replacement = "use --force-reinstall" - deprecated( - reason=reason, - replacement=replacement, - gone_in="21.3", - issue=8711, - ) - # is a local sdist or path -- reinstall ireq.should_reinstall = True else: diff --git a/tests/functional/test_new_resolver.py b/tests/functional/test_new_resolver.py index 052c001791b..26e0886f1ed 100644 --- a/tests/functional/test_new_resolver.py +++ b/tests/functional/test_new_resolver.py @@ -1228,7 +1228,6 @@ def test_new_resolver_does_reinstall_local_sdists(script): expect_stderr=True, ) assert "Installing collected packages: pkg" in result.stdout, str(result) - assert "DEPRECATION" in result.stderr, str(result) script.assert_installed(pkg="1.0")