From 339165e9a4dccff6c17c900c28a5c1d763259c00 Mon Sep 17 00:00:00 2001 From: Gil Forcada Codinachs Date: Wed, 1 Nov 2023 23:50:05 +0100 Subject: [PATCH] feat(gha): use tox environments --- .github/workflows/testing.yml | 29 ++++------------------------- tox.ini | 2 +- 2 files changed, 5 insertions(+), 26 deletions(-) diff --git a/.github/workflows/testing.yml b/.github/workflows/testing.yml index fef5e62..78ada2f 100644 --- a/.github/workflows/testing.yml +++ b/.github/workflows/testing.yml @@ -33,33 +33,12 @@ jobs: - name: pip version run: pip --version - name: Install dependencies + run: python -m pip install tox + - name: Run linting if: matrix.python-version == '3.9' - run: python -m pip install -r requirements-lint.txt - - name: Install dependencies - if: matrix.python-version != '3.9' - run: python -m pip install -r requirements.txt - # formatters - - name: Run pyupgrade - if: matrix.python-version == '3.9' - run: pyupgrade --py37-plus *.py - - name: Run isort - if: matrix.python-version == '3.9' - run: isort --check-only *.py - - name: Run black - if: matrix.python-version == '3.9' - run: black --check --skip-string-normalization *.py - # linters - - name: Lint with bandit - if: matrix.python-version == '3.9' - run: bandit --skip B101 *.py # B101 is assert statements - - name: Lint with codespell - if: matrix.python-version == '3.9' - run: codespell *.rst *.py - - name: Lint with flake8 - if: matrix.python-version == '3.9' - run: flake8 *.py --count --max-complexity=18 --max-line-length=88 --show-source --statistics + run: tox -e lint # tests and coverage - name: Test - run: pytest run_tests.py --cov --cov-report term-missing + run: tox -e test - name: Coverage run: coveralls --service=github diff --git a/tox.ini b/tox.ini index 4a0b95a..bfb4fc1 100644 --- a/tox.ini +++ b/tox.ini @@ -11,7 +11,7 @@ envlist = py312 pypy3 -[testenv] +[testenv:test] description = run the distribution tests use_develop = true skip_install = false