From 0f6605e26b090f2dd6915f789ea6c03adc1218ff Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Bidoul?= Date: Mon, 30 May 2022 13:05:28 +0200 Subject: [PATCH] Improve --dry-run with legacy resolver --- src/pip/_internal/commands/install.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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(