From ac58a7b842d5ca5bbe16915ed9abf4c2aa51c73a Mon Sep 17 00:00:00 2001 From: Sorin Sbarnea Date: Mon, 20 Apr 2020 13:59:28 +0100 Subject: [PATCH] Allow parallel mode without arguments Allows calling tox with `tox -p` in order to use auto mode. Previously it was mandatory to mention `auto` in order to enable parallel mode. This will not change behavior of tox when called without `-p`, which will still keep the non-parallel mode. Fixes: 1418 Signed-off-by: Sorin Sbarnea --- docs/changelog/1418.feature.rst | 1 + src/tox/config/parallel.py | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) create mode 100644 docs/changelog/1418.feature.rst diff --git a/docs/changelog/1418.feature.rst b/docs/changelog/1418.feature.rst new file mode 100644 index 000000000..f08283090 --- /dev/null +++ b/docs/changelog/1418.feature.rst @@ -0,0 +1 @@ +Allow parallel mode without arguments. - by :user:`ssbarnea` diff --git a/src/tox/config/parallel.py b/src/tox/config/parallel.py index ca0dbbd51..1519d58a8 100644 --- a/src/tox/config/parallel.py +++ b/src/tox/config/parallel.py @@ -45,9 +45,11 @@ def add_parallel_flags(parser): parser.add_argument( "-p", "--parallel", + nargs="?", + const="auto", dest="parallel", help="run tox environments in parallel, the argument controls limit: all," - " auto - cpu count, some positive number, zero is turn off", + " auto or missing argument - cpu count, some positive number, 0 to turn off", action="store", type=parse_num_processes, default=DEFAULT_PARALLEL,