Skip to content

Commit

Permalink
WIP... get_installation_order has side effects
Browse files Browse the repository at this point in the history
  • Loading branch information
sbidoul committed Jun 1, 2022
1 parent 621f5bd commit 457851d
Showing 1 changed file with 3 additions and 11 deletions.
14 changes: 3 additions & 11 deletions src/pip/_internal/commands/install.py
Original file line number Diff line number Diff line change
Expand Up @@ -367,22 +367,16 @@ def run(self, options: Values, args: List[str]) -> int:
requirement_set = resolver.resolve(
reqs, check_supported_wheels=not options.target_dir
)
to_install = resolver.get_installation_order(requirement_set)

if options.json_report_file:
report = InstallationReport(
# Use get_installation_order because it does some important
# filtering with the legacy resolver.
resolver.get_installation_order(requirement_set)
)
report = InstallationReport(to_install)
with open(options.json_report_file, "w") as f:
json.dump(report.to_dict(), f)

if options.dry_run:
would_install_items = sorted(
(r.metadata["name"], r.metadata["version"])
# Use get_installation_order because it does some important
# filtering with the legacy resolver.
for r in resolver.get_installation_order(requirement_set)
(r.metadata["name"], r.metadata["version"]) for r in to_install
)
if would_install_items:
write_output(
Expand Down Expand Up @@ -437,8 +431,6 @@ def run(self, options: Values, args: List[str]) -> int:
if not r.use_pep517:
r.legacy_install_reason = 8368

to_install = resolver.get_installation_order(requirement_set)

# Check for conflicts in the package set we're installing.
conflicts: Optional[ConflictDetails] = None
should_warn_about_conflicts = (
Expand Down

0 comments on commit 457851d

Please sign in to comment.