diff options
author | Sorin Sbarnea <ssbarnea@users.noreply.github.com> | 2020-04-20 17:45:21 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-04-20 17:45:21 +0100 |
commit | c0c2d9b99549709881272ba6d1289abe24b993c6 (patch) | |
tree | 994e03aa4adc2d3dfb85a2938f95b2488656f83d | |
parent | 1343f3dc8c30cfe001cf3abf1cc9a139952056ea (diff) | |
download | tox-git-c0c2d9b99549709881272ba6d1289abe24b993c6.tar.gz |
Allow parallel mode without arguments (#1559)
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 <ssbarnea@redhat.com>
-rw-r--r-- | docs/changelog/1418.feature.rst | 1 | ||||
-rw-r--r-- | src/tox/config/parallel.py | 4 |
2 files changed, 4 insertions, 1 deletions
diff --git a/docs/changelog/1418.feature.rst b/docs/changelog/1418.feature.rst new file mode 100644 index 00000000..f0828309 --- /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 ca0dbbd5..1519d58a 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, |