Skip to content

Commit

Permalink
Unified tox configuration (#1113)
Browse files Browse the repository at this point in the history
* 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

* Ignored only testenvs which are actually defined
  • Loading branch information
sliverc authored Dec 12, 2022
1 parent 3d4a926 commit caccd48
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 9 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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
Expand Down
18 changes: 13 additions & 5 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -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 =
Expand All @@ -24,27 +26,33 @@ 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
-rrequirements/requirements-optionals.txt
commands = flake8

[testenv:docs]
basepython = python3.7
basepython = python3.8
deps =
-rrequirements/requirements-testing.txt
-rrequirements/requirements-optionals.txt
-rrequirements/requirements-documentation.txt
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

0 comments on commit caccd48

Please sign in to comment.