Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions poetry/installation/executor.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,14 +107,33 @@ def execute(self, operations): # type: (Operation) -> int
self._sections = OrderedDict()
for _, group in groups:
tasks = []
serial_operations = []
for operation in group:
if self._shutdown:
break

# Some operations are unsafe, we mus execute them serially in a group
# https://github.com/python-poetry/poetry/issues/3086
# https://github.com/python-poetry/poetry/issues/2658
#
# We need to explicitly check source type here, see:
# https://github.com/python-poetry/poetry-core/pull/98
is_parallel_unsafe = operation.job_type == "uninstall" or (
operation.package.develop
and operation.package.source_type in {"directory", "git"}
)
if not operation.skipped and is_parallel_unsafe:
serial_operations.append(operation)
continue

tasks.append(self._executor.submit(self._execute_operation, operation))

try:
wait(tasks)

for operation in serial_operations:
wait([self._executor.submit(self._execute_operation, operation)])
Comment thread
abn marked this conversation as resolved.

except KeyboardInterrupt:
self._shutdown = True

Expand Down