From 62c72ca30c2855c42df2ea3d76b72feb08efb559 Mon Sep 17 00:00:00 2001 From: Christian Clauss Date: Thu, 31 Dec 2020 03:46:57 +0100 Subject: [PATCH 1/5] GitHub Action to lint Python code --- .github/workflows/lint_python.yml | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 .github/workflows/lint_python.yml diff --git a/.github/workflows/lint_python.yml b/.github/workflows/lint_python.yml new file mode 100644 index 000000000..5639a1ce2 --- /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 --select=E9,F63,F7,F82 --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 From b936fcbac5066addea61a3cbf13056cbaeeadeb4 Mon Sep 17 00:00:00 2001 From: Christian Clauss Date: Thu, 31 Dec 2020 03:49:39 +0100 Subject: [PATCH 2/5] tox.ini: py38,py39 --- tox.ini | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tox.ini b/tox.ini index cfbc689ae..b664ae2a9 100644 --- a/tox.ini +++ b/tox.ini @@ -1,5 +1,5 @@ [tox] -envlist = py37,py38,cov-report +envlist = py38,py39,cov-report [testenv] From f343b5a1918000dd55e309889bbf510d68dd8be0 Mon Sep 17 00:00:00 2001 From: Christian Clauss Date: Thu, 31 Dec 2020 03:56:19 +0100 Subject: [PATCH 3/5] skip_missing_interpreters --- tox.ini | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tox.ini b/tox.ini index b664ae2a9..4b9efb9c1 100644 --- a/tox.ini +++ b/tox.ini @@ -1,5 +1,6 @@ [tox] envlist = py38,py39,cov-report +skip_missing_interpreters = true [testenv] @@ -8,7 +9,7 @@ setenv = deps = -r requirements-dev.txt commands = - flake8 patterns/ + flake8 . ; `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/ From 5ef9a81d71820f4c4ea22d0d4de6b94ad32dc888 Mon Sep 17 00:00:00 2001 From: Christian Clauss Date: Thu, 31 Dec 2020 03:59:06 +0100 Subject: [PATCH 4/5] Update lint_python.yml --- .github/workflows/lint_python.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/lint_python.yml b/.github/workflows/lint_python.yml index 5639a1ce2..7a4251f07 100644 --- a/.github/workflows/lint_python.yml +++ b/.github/workflows/lint_python.yml @@ -10,7 +10,7 @@ jobs: - run: bandit -r . || true - run: black --check . || true - run: codespell --quiet-level=2 || true # --ignore-words-list="" --skip="" - - run: flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics + - run: flake8 . --count --show-source --statistics - run: isort --profile black . || true - run: tox - run: pip install -r requirements.txt || true From ab62f57d45ce1b32fcf21a9ffdfd17bd87ff5ba2 Mon Sep 17 00:00:00 2001 From: Christian Clauss Date: Thu, 31 Dec 2020 04:00:15 +0100 Subject: [PATCH 5/5] flake8 . --exclude=./.* --- tox.ini | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tox.ini b/tox.ini index 4b9efb9c1..c969e8913 100644 --- a/tox.ini +++ b/tox.ini @@ -9,7 +9,7 @@ setenv = deps = -r requirements-dev.txt commands = - flake8 . + 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/