Update default setup to use parallelized dep installation

Move deprecation warnings to the precondition function
Deprecate --parallelize-locked-install option
Add --parallel-install-threads option
This commit is contained in:
2021-05-05 16:18:41 -04:00
parent 915233c529
commit dbbbf8186f
4 changed files with 42 additions and 18 deletions

View File

@@ -5,7 +5,6 @@
import concurrent.futures
import contextlib
import typing
from typing import Optional
from typing import Sequence
from typing import Set
@@ -23,7 +22,7 @@ def install(
poetry: "_poetry.Poetry",
venv: ToxVirtualEnv,
packages: Sequence[PoetryPackage],
parallels: Optional[int] = None,
parallels: int = 0,
):
"""Install a bunch of packages to a virtualenv
@@ -55,7 +54,7 @@ def install(
enables/disables the usage of the parallel thread pooler depending on the value of
the ``parallels`` parameter.
"""
if parallels:
if parallels > 0:
with concurrent.futures.ThreadPoolExecutor(
max_workers=parallels
) as executor: