From 5327f3b809e2b639bf02481282791c28102768fe Mon Sep 17 00:00:00 2001 From: Christian Clauss Date: Fri, 22 Oct 2021 02:23:05 +0200 Subject: [PATCH 01/10] GitHub Action to lint Python code --- .github/workflows/lint_python.yml | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 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 00000000..055440ca --- /dev/null +++ b/.github/workflows/lint_python.yml @@ -0,0 +1,30 @@ +name: lint_python +on: [pull_request, push] +jobs: + lint_python: + runs-on: ubuntu-latest + strategy: + matrix: + python-version: ['3.6', '3.7', '3.8', '3.9', '3.10', 'pypy-3.8' ] + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-python@v2 + with: + python-version: ${{ matrix.python-version }} + - run: pip install --upgrade pip wheel + - run: pip install bandit black codespell flake8 flake8-2020 flake8-bugbear + flake8-comprehensions isort mypy pytest pyupgrade safety + - run: bandit --recursive --skip B101 . || true # B101 is assert statements + - run: black --check . || true + - run: codespell || true # --ignore-words-list="" --skip="*.css,*.js,*.lock" + - run: flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics + - run: flake8 . --count --exit-zero --max-complexity=10 --max-line-length=88 + --show-source --statistics + - run: isort --check-only --profile black . || true + - run: pip install -r requirements.txt || pip install --editable . || true + - run: mkdir --parents --verbose .mypy_cache + - run: mypy --ignore-missing-imports --install-types --non-interactive . || true + - run: pytest . || true + - run: pytest --doctest-modules . || true + - run: shopt -s globstar && pyupgrade --py36-plus **/*.py || true + - run: safety check From b8fb105475925cd92089e26eda57e77547190502 Mon Sep 17 00:00:00 2001 From: Christian Clauss Date: Fri, 22 Oct 2021 02:38:16 +0200 Subject: [PATCH 02/10] safety check || true --- .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 055440ca..a5400f0a 100644 --- a/.github/workflows/lint_python.yml +++ b/.github/workflows/lint_python.yml @@ -27,4 +27,4 @@ jobs: - run: pytest . || true - run: pytest --doctest-modules . || true - run: shopt -s globstar && pyupgrade --py36-plus **/*.py || true - - run: safety check + - run: safety check || true From d765461f710033e6db28f55036a164d28ef601fe Mon Sep 17 00:00:00 2001 From: Christian Clauss Date: Fri, 22 Oct 2021 02:50:28 +0200 Subject: [PATCH 03/10] pip install --editable . --- .github/workflows/lint_python.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/lint_python.yml b/.github/workflows/lint_python.yml index a5400f0a..c455157a 100644 --- a/.github/workflows/lint_python.yml +++ b/.github/workflows/lint_python.yml @@ -21,7 +21,8 @@ jobs: - run: flake8 . --count --exit-zero --max-complexity=10 --max-line-length=88 --show-source --statistics - run: isort --check-only --profile black . || true - - run: pip install -r requirements.txt || pip install --editable . || true + # - run: pip install -r requirements.txt || pip install --editable . || true + - run: pip install --editable . - run: mkdir --parents --verbose .mypy_cache - run: mypy --ignore-missing-imports --install-types --non-interactive . || true - run: pytest . || true From 46fafe5a097fcf560c1ec938e90fea8076857d2e Mon Sep 17 00:00:00 2001 From: Christian Clauss Date: Fri, 22 Oct 2021 02:53:51 +0200 Subject: [PATCH 04/10] 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 c455157a..067dc106 100644 --- a/.github/workflows/lint_python.yml +++ b/.github/workflows/lint_python.yml @@ -21,7 +21,7 @@ jobs: - run: flake8 . --count --exit-zero --max-complexity=10 --max-line-length=88 --show-source --statistics - run: isort --check-only --profile black . || true - # - run: pip install -r requirements.txt || pip install --editable . || true + - run: pip install -r requirements.txt - run: pip install --editable . - run: mkdir --parents --verbose .mypy_cache - run: mypy --ignore-missing-imports --install-types --non-interactive . || true From 2f2d5ce102e806581e161f3b0f5bddb5dbb6286c Mon Sep 17 00:00:00 2001 From: Christian Clauss Date: Fri, 22 Oct 2021 02:58:01 +0200 Subject: [PATCH 05/10] fail-fast: false --- .github/workflows/lint_python.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/lint_python.yml b/.github/workflows/lint_python.yml index 067dc106..4d378613 100644 --- a/.github/workflows/lint_python.yml +++ b/.github/workflows/lint_python.yml @@ -4,6 +4,7 @@ jobs: lint_python: runs-on: ubuntu-latest strategy: + fail-fast: false matrix: python-version: ['3.6', '3.7', '3.8', '3.9', '3.10', 'pypy-3.8' ] steps: From 693fd15a0b2e44a71cc9cddce89aa2fc6c32cb47 Mon Sep 17 00:00:00 2001 From: Christian Clauss Date: Fri, 22 Oct 2021 03:06:06 +0200 Subject: [PATCH 06/10] numpy==1.21.3 --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index f8b347e9..202477b8 100644 --- a/requirements.txt +++ b/requirements.txt @@ -13,7 +13,7 @@ importlib-metadata==0.17 Jinja2==2.10.1 MarkupSafe==1.1.1 more-itertools==7.0.0 -numpy==1.16.4 +numpy==1.21.3 packaging==19.0 pluggy==0.12.0 py==1.8.0 From 9e71f5bff87207bd91c060d30d1a52a41f381879 Mon Sep 17 00:00:00 2001 From: Christian Clauss Date: Fri, 22 Oct 2021 03:09:54 +0200 Subject: [PATCH 07/10] numpy==1.21.3; python_version >= '3.9' --- requirements.txt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index 202477b8..bf262f0c 100644 --- a/requirements.txt +++ b/requirements.txt @@ -13,7 +13,8 @@ importlib-metadata==0.17 Jinja2==2.10.1 MarkupSafe==1.1.1 more-itertools==7.0.0 -numpy==1.21.3 +numpy==1.16.4; python_version < '3.9' +numpy==1.21.3; python_version >= '3.9' packaging==19.0 pluggy==0.12.0 py==1.8.0 From 398d046156e5c034c064839481f2d76bc2dde77a Mon Sep 17 00:00:00 2001 From: Christian Clauss Date: Fri, 22 Oct 2021 08:07:47 +0200 Subject: [PATCH 08/10] Delete pytest.ini --- pytest.ini | 2 -- 1 file changed, 2 deletions(-) delete mode 100644 pytest.ini diff --git a/pytest.ini b/pytest.ini deleted file mode 100644 index 01ab5ea0..00000000 --- a/pytest.ini +++ /dev/null @@ -1,2 +0,0 @@ -[pytest] -testpaths = ffmpeg/tests From 32d42a848926179fc6a926e5234a1744d8fa6ab3 Mon Sep 17 00:00:00 2001 From: Christian Clauss Date: Fri, 22 Oct 2021 08:12:21 +0200 Subject: [PATCH 09/10] sudo apt update && sudo apt install ffmpeg --- .github/workflows/lint_python.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/lint_python.yml b/.github/workflows/lint_python.yml index 4d378613..4683050d 100644 --- a/.github/workflows/lint_python.yml +++ b/.github/workflows/lint_python.yml @@ -12,6 +12,7 @@ jobs: - uses: actions/setup-python@v2 with: python-version: ${{ matrix.python-version }} + - run: sudo apt update && sudo apt install ffmpeg - run: pip install --upgrade pip wheel - run: pip install bandit black codespell flake8 flake8-2020 flake8-bugbear flake8-comprehensions isort mypy pytest pyupgrade safety From dd2f2ce780e8d54447aa3db784c634ef4cdc7268 Mon Sep 17 00:00:00 2001 From: Christian Clauss Date: Fri, 22 Oct 2021 08:18:02 +0200 Subject: [PATCH 10/10] Make pytest a mandatory test --- .github/workflows/lint_python.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/lint_python.yml b/.github/workflows/lint_python.yml index 4683050d..c49d352e 100644 --- a/.github/workflows/lint_python.yml +++ b/.github/workflows/lint_python.yml @@ -27,7 +27,6 @@ jobs: - run: pip install --editable . - run: mkdir --parents --verbose .mypy_cache - run: mypy --ignore-missing-imports --install-types --non-interactive . || true - - run: pytest . || true - - run: pytest --doctest-modules . || true + - run: pytest - run: shopt -s globstar && pyupgrade --py36-plus **/*.py || true - run: safety check || true