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

Imply --parallel when --parallel-no-spinner is passed #3159

Merged
merged 10 commits into from
Nov 29, 2023
1 change: 1 addition & 0 deletions docs/changelog/3158.bugfix.rst
@@ -0,0 +1 @@
``--parallel-no-spinner`` flag now implies ``--parallel``
4 changes: 2 additions & 2 deletions docs/user_guide.rst
Expand Up @@ -394,8 +394,8 @@ Parallel mode
- ``auto`` to limit it to CPU count,
- or pass an integer to set that limit.
- Parallel mode displays a progress spinner while running tox environments in parallel, and reports outcome of these as
soon as they have been completed with a human readable duration timing attached. This spinner can be disabled via the
``--parallel-no-spinner`` flag.
soon as they have been completed with a human readable duration timing attached. To run parallelly without the spinner,
you can use the ``--parallel-no-spinner`` flag.
- Parallel mode by default shows output only of failed environments and ones marked as :ref:`parallel_show_output`
``=True``.
- There's now a concept of dependency between environments (specified via :ref:`depends`), tox will re-order the
Expand Down
2 changes: 1 addition & 1 deletion src/tox/session/cmd/legacy.py
Expand Up @@ -110,7 +110,7 @@ def legacy(state: State) -> int:
option.env = CliEnv(["py"])
option.devenv_path = Path(option.devenv_path)
return devenv(state)
if option.parallel != 0: # only 0 means sequential
if option.parallel_no_spinner is True or option.parallel != 0: # only 0 means sequential
tusharsadhwani marked this conversation as resolved.
Show resolved Hide resolved
return run_parallel(state)
return run_sequential(state)

Expand Down
4 changes: 2 additions & 2 deletions src/tox/session/cmd/run/parallel.py
Expand Up @@ -74,7 +74,7 @@ def parallel_flags(
"--parallel-no-spinner",
action="store_true",
dest="parallel_no_spinner",
help="do not show the spinner",
help="run tox environments in parallel, but don't show the spinner, implies --parallel",
)


Expand All @@ -83,7 +83,7 @@ def run_parallel(state: State) -> int:
option = state.conf.options
return execute(
state,
max_workers=option.parallel,
max_workers=None if option.parallel_no_spinner is True else option.parallel,
has_spinner=option.parallel_no_spinner is False and option.parallel_live is False,
live=option.parallel_live,
)