diff --git a/.github/workflows/pythonpackage.yml b/.github/workflows/pythonpackage.yml index 9099c8d..88e717c 100644 --- a/.github/workflows/pythonpackage.yml +++ b/.github/workflows/pythonpackage.yml @@ -1,20 +1,12 @@ name: Python package - -on: - push: - branches: [ master ] - pull_request: - branches: [ master ] - workflow_dispatch: +on: [push] jobs: build: - runs-on: ubuntu-latest strategy: matrix: python-version: ['3.8', '3.9', '3.10', '3.11'] - steps: - uses: actions/checkout@v2 - name: Set up Python ${{ matrix.python-version }} @@ -23,19 +15,15 @@ jobs: python-version: ${{ matrix.python-version }} - name: Install dependencies run: | - python -m pip install --upgrade pip setuptools - pip install -e .[pywavefront,trimesh] - pip install -r tests/requirements.txt - # pip install -r requirements.txt + python -m pip install --upgrade pip + pip install -e .[tests] - name: Lint with flake8 run: | - # pip install flake8 # stop the build if there are Python syntax errors or undefined names flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics # exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics - name: Test with pytest run: | - pip install pytest # TODO: Figure out if we can run headless tests pytest tests/test_docs.py diff --git a/setup.cfg b/setup.cfg index 2ad49d2..f05a920 100644 --- a/setup.cfg +++ b/setup.cfg @@ -49,3 +49,12 @@ pywavefront = pywavefront>=1.2.0,<2 trimesh = trimesh>=3.2.6,<4 tk = pyopengltk>=0.0.3 pygame = pygame~=2.0.1 +tests = + pytest + tox + tox-gh-actions + flake8 + coverage + pywavefront + trimesh + scipy diff --git a/tests/requirements.txt b/tests/requirements.txt deleted file mode 100644 index fad5250..0000000 --- a/tests/requirements.txt +++ /dev/null @@ -1,4 +0,0 @@ -pytest -tox -flake8 -coverage diff --git a/tox.ini b/tox.ini index 14c044b..7fae1fc 100644 --- a/tox.ini +++ b/tox.ini @@ -2,7 +2,7 @@ # as flake8 can fail to parse the file on OS X and Windows [tox] -skipsdist = False +skipsdist = True envlist = py36 py37 @@ -11,6 +11,14 @@ envlist = py310 pep8 +[gh-actions] +python = + 3.5: py35 + 3.6: py36 + 3.7: py37 + 3.8: py38 + pep8: py38 + [testenv] usedevelop = True basepython =