Skip to content

Commit

Permalink
Merge pull request #10543 from pradyunsg/drop-sdist-reinstall
Browse files Browse the repository at this point in the history
Un-deprecate source distribution re-installation behaviour
  • Loading branch information
pradyunsg authored Oct 9, 2021
2 parents 02b4f86 + 68e22aa commit ae2c9ed
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 22 deletions.
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

0 comments on commit ae2c9ed

Please sign in to comment.