Skip to content

Commit

Permalink
Clearer msg for already installed deps when updating (#5319)
Browse files Browse the repository at this point in the history
  • Loading branch information
amorison authored and pradyunsg committed Jun 19, 2018
1 parent ca031c1 commit c16ff34
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 1 deletion.
1 change: 1 addition & 0 deletions news/5319.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Improve status message when upgrade is skipped due to only-if-needed strategy
2 changes: 1 addition & 1 deletion src/pip/_internal/resolve.py
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ def _check_skip_installed(self, req_to_install):

if not self._is_upgrade_allowed(req_to_install):
if self.upgrade_strategy == "only-if-needed":
return 'not upgraded as not directly required'
return 'already satisfied, skipping upgrade'
return 'already satisfied'

# Check for the possibility of an upgrade. For link-based
Expand Down
4 changes: 4 additions & 0 deletions tests/functional/test_install_upgrade.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,10 @@ def test_only_if_needed_does_not_upgrade_deps_when_satisfied(script):
(script.site_packages / 'simple-2.0-py%s.egg-info' % pyversion)
not in result.files_deleted
), "should not have uninstalled simple==2.0"
assert (
"Requirement already satisfied, skipping upgrade: simple"
in result.stdout
), "did not print correct message for not-upgraded requirement"


def test_only_if_needed_does_upgrade_deps_when_no_longer_satisfied(script):
Expand Down

0 comments on commit c16ff34

Please sign in to comment.