Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable parallelization in CI #2663

Merged
merged 5 commits into from
Jul 28, 2020
Merged
Show file tree
Hide file tree
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
5 changes: 1 addition & 4 deletions poetry/installation/executor.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@


class Executor(object):
def __init__(self, env, pool, config, io, parallel=None):
def __init__(self, env, pool, config, io, parallel=True):
self._env = env
self._io = io
self._dry_run = False
Expand All @@ -39,9 +39,6 @@ def __init__(self, env, pool, config, io, parallel=None):
self._chef = Chef(config, self._env)
self._chooser = Chooser(pool, self._env)

if parallel is None:
parallel = self.supports_fancy_output()

if parallel:
# This should be directly handled by ThreadPoolExecutor
# however, on some systems the number of CPUs cannot be determined
Expand Down
8 changes: 5 additions & 3 deletions tests/console/commands/test_add.py
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,7 @@ def test_add_git_constraint_with_extras(app, repo, tester, tmp_venv):
• Installing demo (0.1.2 9cf87a2)
"""

assert expected == tester.io.fetch_output()
assert expected.strip() == tester.io.fetch_output().strip()
assert 4 == tester._command.installer.executor.installations_count

content = app.poetry.file.read()["tool"]["poetry"]
Expand Down Expand Up @@ -512,8 +512,10 @@ def test_add_url_constraint_wheel_with_extras(app, repo, tester, mocker):
• Installing tomlkit (0.5.5)
• Installing demo (0.1.0 https://python-poetry.org/distributions/demo-0.1.0-py2.py3-none-any.whl)
"""

assert expected == tester.io.fetch_output()
# Order might be different, split into lines and compare the overall output.
expected = set(expected.splitlines())
output = set(tester.io.fetch_output().splitlines())
assert expected == output
assert 4 == tester._command.installer.executor.installations_count

content = app.poetry.file.read()["tool"]["poetry"]
Expand Down
5 changes: 4 additions & 1 deletion tests/installation/test_executor.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,10 @@ def test_execute_executes_a_batch_of_operations(
""".format(
file_package.source_url, directory_package.source_url
)
assert expected == io.fetch_output()

expected = set(expected.splitlines())
output = set(io.fetch_output().splitlines())
assert expected == output
assert 5 == len(env.executed)


Expand Down