diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index e81e78d580..a6f437ea29 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -14,6 +14,9 @@ jobs: #- {name: Linux, python: '3.9', os: ubuntu-latest, tox: py39} #- {name: Windows, python: '3.9', os: windows-latest, tox: py39} #- {name: Mac, python: '3.9', os: macos-latest, tox: py39} + - { name: "flake8", python: "3.10", os: ubuntu-latest, tox: "flake8" } + - { name: "black", python: "3.10", os: ubuntu-latest, tox: "black" } + - { name: "mypy", python: "3.10", os: ubuntu-latest, tox: "mypy" } - { name: "3.10", python: "3.10", os: ubuntu-latest, tox: py310 } - { name: "3.9", python: "3.9", os: ubuntu-latest, tox: py39 } - { name: "3.8", python: "3.8", os: ubuntu-latest, tox: py38 } diff --git a/tox.ini b/tox.ini index 502c677a83..ae06dac9eb 100644 --- a/tox.ini +++ b/tox.ini @@ -1,5 +1,9 @@ [tox] -envlist = py{36,37,38,39,310} +envlist = + flake8 + black + mypy + py{36,37,38,39,310} [flake8] extend-exclude = build,examples/issue_*.py,src/readthedocs-sphinx-search/ @@ -11,24 +15,29 @@ per-file-ignores = [testenv] deps = codecov - flake8 mock retry pyquery cryptography - black==22.3.0 - mypy allowlist_externals = bash timeout grep commands = - flake8 . --count --show-source --statistics coverage run -m unittest discover [] - black --check . - mypy locust/ bash -ec 'PYTHONUNBUFFERED=1 timeout 2s python3 examples/debugging.py >out.txt 2>err.txt || true' grep -qm 1 '/hello' out.txt bash -ec '! grep . err.txt' # should be empty bash -ec 'PYTHONUNBUFFERED=1 python3 examples/debugging_advanced.py | grep done' +[testenv:black] +deps = black==22.3.0 +commands = black --check . + +[testenv:flake8] +deps = flake8 +commands = flake8 . --count --show-source --statistics + +[testenv:mypy] +deps = mypy +commands = mypy locust/