Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Un-deprecate source distribution re-installation behaviour #10543

Merged
merged 1 commit into from
Oct 9, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions news/8711.removal.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Un-deprecate source distribution re-installation behaviour.
21 changes: 0 additions & 21 deletions src/pip/_internal/resolution/resolvelib/resolver.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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:
Expand Down
1 change: 0 additions & 1 deletion tests/functional/test_new_resolver.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")


Expand Down