Skip to content

Commit 457851d

Browse files
committed
WIP... get_installation_order has side effects
1 parent 621f5bd commit 457851d

File tree

1 file changed

+3
-11
lines changed

1 file changed

+3
-11
lines changed

src/pip/_internal/commands/install.py

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -367,22 +367,16 @@ def run(self, options: Values, args: List[str]) -> int:
367367
requirement_set = resolver.resolve(
368368
reqs, check_supported_wheels=not options.target_dir
369369
)
370+
to_install = resolver.get_installation_order(requirement_set)
370371

371372
if options.json_report_file:
372-
report = InstallationReport(
373-
# Use get_installation_order because it does some important
374-
# filtering with the legacy resolver.
375-
resolver.get_installation_order(requirement_set)
376-
)
373+
report = InstallationReport(to_install)
377374
with open(options.json_report_file, "w") as f:
378375
json.dump(report.to_dict(), f)
379376

380377
if options.dry_run:
381378
would_install_items = sorted(
382-
(r.metadata["name"], r.metadata["version"])
383-
# Use get_installation_order because it does some important
384-
# filtering with the legacy resolver.
385-
for r in resolver.get_installation_order(requirement_set)
379+
(r.metadata["name"], r.metadata["version"]) for r in to_install
386380
)
387381
if would_install_items:
388382
write_output(
@@ -437,8 +431,6 @@ def run(self, options: Values, args: List[str]) -> int:
437431
if not r.use_pep517:
438432
r.legacy_install_reason = 8368
439433

440-
to_install = resolver.get_installation_order(requirement_set)
441-
442434
# Check for conflicts in the package set we're installing.
443435
conflicts: Optional[ConflictDetails] = None
444436
should_warn_about_conflicts = (

0 commit comments

Comments
 (0)