From 744a9e38ac94e308cab46efaa1e945eb912fc400 Mon Sep 17 00:00:00 2001 From: Oliver Sauder Date: Thu, 8 Dec 2022 22:29:06 +0400 Subject: [PATCH 1/2] Unified tox configuration * Followed example of DRF using -f cmd line of tox v4 instead of tox-py * For linting jobs updated to Python 3.8 as will be required by future updates of Flake8 * Added missing black job --- .github/workflows/tests.yml | 8 ++++---- tox.ini | 10 ++++++---- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 9b277e3f..75573cb7 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -20,9 +20,9 @@ jobs: - name: Install dependencies run: | python -m pip install --upgrade pip - pip install tox tox-py + pip install tox - name: Run tox targets for ${{ matrix.python-version }} - run: tox --py current + run: tox run -f py$(echo ${{ matrix.python-version }} | tr -d .) - name: Upload coverage report uses: codecov/codecov-action@v2 with: @@ -36,10 +36,10 @@ jobs: tox-env: ["black", "lint", "docs"] steps: - uses: actions/checkout@v2 - - name: Set up Python 3.7 + - name: Set up Python 3.8 uses: actions/setup-python@v2 with: - python-version: 3.7 + python-version: 3.8 - name: Install dependencies run: | python -m pip install --upgrade pip diff --git a/tox.ini b/tox.ini index 563b08ef..e33d8d07 100644 --- a/tox.ini +++ b/tox.ini @@ -3,7 +3,9 @@ envlist = py{37,38,39,310}-django32-drf{313,314,master}, py{38,39,310}-django40-drf{313,314,master}, py{38,39,310,311}-django41-drf{314,master}, - lint,docs + black, + docs, + lint [testenv] deps = @@ -24,13 +26,13 @@ commands = pytest --cov --no-cov-on-fail --cov-report xml {posargs} [testenv:black] -basepython = python3.7 +basepython = python3.8 deps = -rrequirements/requirements-codestyle.txt commands = black --check . [testenv:lint] -basepython = python3.7 +basepython = python3.8 deps = -rrequirements/requirements-codestyle.txt -rrequirements/requirements-testing.txt @@ -38,7 +40,7 @@ deps = commands = flake8 [testenv:docs] -basepython = python3.7 +basepython = python3.8 deps = -rrequirements/requirements-testing.txt -rrequirements/requirements-optionals.txt From 7cdb3f1099c61a5b21a7469b8b9be82e8409bfb4 Mon Sep 17 00:00:00 2001 From: Oliver Sauder Date: Mon, 12 Dec 2022 21:53:15 +0400 Subject: [PATCH 2/2] Ignored only testenvs which are actually defined --- tox.ini | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/tox.ini b/tox.ini index e33d8d07..c9fd139b 100644 --- a/tox.ini +++ b/tox.ini @@ -48,5 +48,11 @@ deps = commands = sphinx-build -W -b html -d docs/_build/doctrees docs docs/_build/html -[testenv:py{37,38,39,310}-django{32,40,41}-drfmaster] +[testenv:py{37,38,39,310}-django32-drfmaster] +ignore_outcome = true + +[testenv:py{38,39,310}-django40-drfmaster] +ignore_outcome = true + +[testenv:py{38,39,310,311}-django41-drfmaster] ignore_outcome = true