diff --git a/src/pip/_internal/commands/install.py b/src/pip/_internal/commands/install.py index 191239750eb..02bea04501f 100644 --- a/src/pip/_internal/commands/install.py +++ b/src/pip/_internal/commands/install.py @@ -356,7 +356,9 @@ def run(self, options: Values, args: List[str]) -> int: if options.dry_run: would_install_items = sorted( (r.metadata["name"], r.metadata["version"]) - for r in requirement_set.all_requirements + # Use get_installation_order because it does some important + # filtering with the legacy resolver. + for r in resolver.get_installation_order(requirement_set) ) if would_install_items: write_output(