Skip to content

Commit

Permalink
Drop conflict warning when using --no-deps-for
Browse files Browse the repository at this point in the history
  • Loading branch information
leorochael committed Jun 25, 2024
1 parent 83e92fa commit 0973e26
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
3 changes: 2 additions & 1 deletion src/pip/_internal/commands/install.py
Original file line number Diff line number Diff line change
Expand Up @@ -442,7 +442,8 @@ def run(self, options: Values, args: List[str]) -> int:
# Check for conflicts in the package set we're installing.
conflicts: Optional[ConflictDetails] = None
should_warn_about_conflicts = (
not options.ignore_dependencies and options.warn_about_conflicts
not (options.ignore_dependencies or options.ignore_dependencies_for)
and options.warn_about_conflicts
)
if should_warn_about_conflicts:
conflicts = self._determine_conflicts(to_install)
Expand Down
3 changes: 1 addition & 2 deletions tests/functional/test_new_resolver.py
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,7 @@ def test_new_resolver_ignore_dependencies_for(script: PipTestEnvironment) -> Non
"dep2",
"0.1.0",
)
result = script.pip(
script.pip(
"install",
"--no-cache-dir",
"--no-index",
Expand All @@ -253,7 +253,6 @@ def test_new_resolver_ignore_dependencies_for(script: PipTestEnvironment) -> Non
)
script.assert_installed(base="0.1.0", base2="0.1.0", dep2="0.1.0")
script.assert_not_installed("dep")
assert "base 0.1.0 requires dep, which is not installed." in result.stderr


@pytest.mark.parametrize(
Expand Down

0 comments on commit 0973e26

Please sign in to comment.