diff --git a/.github/workflows/lint_python.yml b/.github/workflows/lint_python.yml new file mode 100644 index 000000000..7a4251f07 --- /dev/null +++ b/.github/workflows/lint_python.yml @@ -0,0 +1,19 @@ +name: lint_python +on: [pull_request, push] +jobs: + lint_python: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-python@v2 + - run: pip install bandit black codespell flake8 isort pytest pyupgrade tox + - run: bandit -r . || true + - run: black --check . || true + - run: codespell --quiet-level=2 || true # --ignore-words-list="" --skip="" + - run: flake8 . --count --show-source --statistics + - run: isort --profile black . || true + - run: tox + - run: pip install -r requirements.txt || true + - run: pytest . || true + - run: pytest --doctest-modules . || true + - run: shopt -s globstar && pyupgrade --py36-plus **/*.py || true diff --git a/tox.ini b/tox.ini index 96239dc8c..ee8b95793 100644 --- a/tox.ini +++ b/tox.ini @@ -1,5 +1,6 @@ [tox] -envlist = py37,py39,cov-report +envlist = py37,py38,py39,cov-report +skip_missing_interpreters = true [testenv] @@ -8,7 +9,7 @@ setenv = deps = -r requirements-dev.txt commands = - flake8 patterns/ + flake8 . --exclude=./.* ; `randomly-seed` option from `pytest-randomly` helps with deterministic outputs for examples like `other/blackboard.py` pytest --randomly-seed=1234 --doctest-modules patterns/ pytest -s -vv --cov={envsitepackagesdir}/patterns --log-level=INFO tests/