summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrett Holman <bholman.devel@gmail.com>2022-01-31 14:39:45 -0700
committerGitHub <noreply@github.com>2022-01-31 15:39:45 -0600
commit96dca24bf58b0d2f8adcd83f54ca073092d68739 (patch)
tree6295fa9aeec586729904bf1b7ba57b6a8e7691bc
parent902aa44e6f4d267b5a7a59abb463f7b22c8d14d8 (diff)
downloadvyos-cloud-init-96dca24bf58b0d2f8adcd83f54ca073092d68739.tar.gz
vyos-cloud-init-96dca24bf58b0d2f8adcd83f54ca073092d68739.zip
fix parallel tox execution (#1214)
-rw-r--r--CONTRIBUTING.rst2
-rw-r--r--tox.ini53
2 files changed, 34 insertions, 21 deletions
diff --git a/CONTRIBUTING.rst b/CONTRIBUTING.rst
index aa09c61e..cbd1ce3b 100644
--- a/CONTRIBUTING.rst
+++ b/CONTRIBUTING.rst
@@ -19,7 +19,7 @@ Before any pull request can be accepted, you must do the following:
`tools/.github-cla-signers`_
* Add or update any `unit tests`_ accordingly
* Add or update any `integration tests`_ (if applicable)
-* Format code (using black and isort) with `tox -e format`
+* Format code (using black and isort) with `tox -e do_format`
* Ensure unit tests and linting pass using `tox`_
* Submit a PR against the `main` branch of the `cloud-init` repository
diff --git a/tox.ini b/tox.ini
index 52849557..5037fa69 100644
--- a/tox.ini
+++ b/tox.ini
@@ -9,39 +9,52 @@ setenv =
passenv=
PYTEST_ADDOPTS
-[flake_env]
-envdir = {toxworkdir}/.flake_env
-deps =
- flake8==3.9.2
- pylint==2.11.1
- black==21.12b0
- isort==5.10.1
- -r{toxinidir}/test-requirements.txt
- -r{toxinidir}/integration-requirements.txt
+[format_deps]
+flake8==3.9.2
+pylint==2.11.1
+black==21.12b0
+isort==5.10.1
[testenv:flake8]
-envdir = {[flake_env]envdir}
-deps = {[flake_env]deps}
+deps =
+ flake8=={[format_deps]flake8}
commands = {envpython} -m flake8 {posargs:cloudinit/ tests/ tools/ setup.py}
[testenv:pylint]
-envdir = {[flake_env]envdir}
-deps = {[flake_env]deps}
+deps =
+ pylint=={[format_deps]pylint}
+ -r{toxinidir}/test-requirements.txt
+ -r{toxinidir}/integration-requirements.txt
commands = {envpython} -m pylint {posargs:cloudinit tests tools}
[testenv:black]
-envdir = {[flake_env]envdir}
-deps = {[flake_env]deps}
+deps =
+ black=={[format_deps]black}
commands = {envpython} -m black . --check
[testenv:isort]
-envdir = {[flake_env]envdir}
-deps = {[flake_env]deps}
+deps =
+ isort=={[format_deps]isort}
commands = {envpython} -m isort . --check-only
-[testenv:format]
-envdir = {[flake_env]envdir}
-deps = {[flake_env]deps}
+[testenv:check_format]
+deps =
+ flake8=={[format_deps]flake8}
+ pylint=={[format_deps]pylint}
+ black=={[format_deps]black}
+ isort=={[format_deps]isort}
+ -r{toxinidir}/test-requirements.txt
+ -r{toxinidir}/integration-requirements.txt
+commands =
+ {[testenv:black]commands}
+ {[testenv:isort]commands}
+ {[testenv:flake8]commands}
+ {[testenv:pylint]commands}
+
+[testenv:do_format]
+deps =
+ black=={[format_deps]black}
+ isort=={[format_deps]isort}
commands =
{envpython} -m isort .
{envpython} -m black .