From 30e3ef2c9be03f0966bf3bd61b38010c0439d2fd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jeremy=20Lain=C3=A9?= Date: Wed, 1 Nov 2023 23:27:32 +0100 Subject: [PATCH] Simplify linter tests --- .github/workflows/tests.yml | 29 +++++------------------------ Makefile | 5 +++-- scripts/test | 14 -------------- tests/requirements.txt | 5 +++-- 4 files changed, 11 insertions(+), 42 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 996a60bf4..edca189f9 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -12,41 +12,22 @@ on: - '**.txt' jobs: style: - name: "${{ matrix.config.suite }}" runs-on: ubuntu-latest - strategy: - matrix: - config: - - {suite: black} - - {suite: flake8} - - {suite: isort} - - env: - PYAV_PYTHON: python3 - PYAV_LIBRARY: ffmpeg-4.3 # doesn't matter steps: - - uses: actions/checkout@v4 - name: Checkout + - name: Checkout + uses: actions/checkout@v4 - name: Python uses: actions/setup-python@v4 with: python-version: 3.8 - - name: Environment - run: env | sort - - name: Packages - run: | - . scripts/activate.sh - # A bit of a hack that we can get away with this. - python -m pip install ${{ matrix.config.suite }} + run: pip install -r tests/requirements.txt - - name: "${{ matrix.config.suite }}" - run: | - . scripts/activate.sh - ./scripts/test ${{ matrix.config.suite }} + - name: Linters + run: make lint nix: name: "py-${{ matrix.config.python }} lib-${{ matrix.config.ffmpeg }} ${{matrix.config.os}}" diff --git a/Makefile b/Makefile index 6cb954dea..fd4d4ed51 100644 --- a/Makefile +++ b/Makefile @@ -34,8 +34,9 @@ fate-suite: rsync -vrltLW rsync://fate-suite.ffmpeg.org/fate-suite/ tests/assets/fate-suite/ lint: - TESTSUITE=flake8 scripts/test - TESTSUITE=isort scripts/test + black --check av examples tests + flake8 av examples tests + isort --check-only --diff av examples tests test: $(PYTHON) setup.py test diff --git a/scripts/test b/scripts/test index 806011859..3eca2feb7 100755 --- a/scripts/test +++ b/scripts/test @@ -18,20 +18,6 @@ istest() { return $? } -if istest black; then - $PYAV_PYTHON -m black --check av examples tests -fi - -if istest flake8; then - # Settings are in setup.cfg - $PYAV_PYTHON -m flake8 av examples tests -fi - -if istest isort; then - # More settings in setup.cfg - $PYAV_PYTHON -m isort --check-only --diff av examples tests -fi - if istest main; then $PYAV_PYTHON setup.py test fi diff --git a/tests/requirements.txt b/tests/requirements.txt index 2a321a28d..36d21ecf9 100644 --- a/tests/requirements.txt +++ b/tests/requirements.txt @@ -1,8 +1,9 @@ autopep8 -Cython +black +cython editorconfig flake8 isort numpy -Pillow +pillow sphinx < 4.4