Skip to content

Commit

Permalink
executor: update pip first before other (parallel) installs
Browse files Browse the repository at this point in the history
  • Loading branch information
radoering authored and neersighted committed Sep 21, 2022
1 parent 93e23bc commit bbbd1dc
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions src/poetry/installation/executor.py
Original file line number Diff line number Diff line change
Expand Up @@ -143,10 +143,18 @@ def execute(self, operations: list[Operation]) -> int:
if operations and (self._enabled or self._dry_run):
self._display_summary(operations)

# We group operations by priority
groups = itertools.groupby(operations, key=lambda o: -o.priority)
self._sections = {}
self._yanked_warnings = []

# pip has to be installed first without parallelism if we install via pip
for i, op in enumerate(operations):
if op.package.name == "pip":
wait([self._executor.submit(self._execute_operation, op)])
del operations[i]
break

# We group operations by priority
groups = itertools.groupby(operations, key=lambda o: -o.priority)
for _, group in groups:
tasks = []
serial_operations = []
Expand Down

0 comments on commit bbbd1dc

Please sign in to comment.