Skip to content

Commit

Permalink
Simplify linter tests
Browse files Browse the repository at this point in the history
  • Loading branch information
jlaine committed Nov 2, 2023
1 parent f9a5e7e commit 30e3ef2
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 42 deletions.
29 changes: 5 additions & 24 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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}}"
Expand Down
5 changes: 3 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
14 changes: 0 additions & 14 deletions scripts/test
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 3 additions & 2 deletions tests/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
autopep8
Cython
black
cython
editorconfig
flake8
isort
numpy
Pillow
pillow
sphinx < 4.4

0 comments on commit 30e3ef2

Please sign in to comment.