Skip to content

Commit caccd48

Browse files
authored
Unified tox configuration (#1113)
* 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
1 parent 3d4a926 commit caccd48

File tree

2 files changed

+17
-9
lines changed

2 files changed

+17
-9
lines changed

.github/workflows/tests.yml

+4-4
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,9 @@ jobs:
2020
- name: Install dependencies
2121
run: |
2222
python -m pip install --upgrade pip
23-
pip install tox tox-py
23+
pip install tox
2424
- name: Run tox targets for ${{ matrix.python-version }}
25-
run: tox --py current
25+
run: tox run -f py$(echo ${{ matrix.python-version }} | tr -d .)
2626
- name: Upload coverage report
2727
uses: codecov/codecov-action@v2
2828
with:
@@ -36,10 +36,10 @@ jobs:
3636
tox-env: ["black", "lint", "docs"]
3737
steps:
3838
- uses: actions/checkout@v2
39-
- name: Set up Python 3.7
39+
- name: Set up Python 3.8
4040
uses: actions/setup-python@v2
4141
with:
42-
python-version: 3.7
42+
python-version: 3.8
4343
- name: Install dependencies
4444
run: |
4545
python -m pip install --upgrade pip

tox.ini

+13-5
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,9 @@ envlist =
33
py{37,38,39,310}-django32-drf{313,314,master},
44
py{38,39,310}-django40-drf{313,314,master},
55
py{38,39,310,311}-django41-drf{314,master},
6-
lint,docs
6+
black,
7+
docs,
8+
lint
79

810
[testenv]
911
deps =
@@ -24,27 +26,33 @@ commands =
2426
pytest --cov --no-cov-on-fail --cov-report xml {posargs}
2527

2628
[testenv:black]
27-
basepython = python3.7
29+
basepython = python3.8
2830
deps =
2931
-rrequirements/requirements-codestyle.txt
3032
commands = black --check .
3133

3234
[testenv:lint]
33-
basepython = python3.7
35+
basepython = python3.8
3436
deps =
3537
-rrequirements/requirements-codestyle.txt
3638
-rrequirements/requirements-testing.txt
3739
-rrequirements/requirements-optionals.txt
3840
commands = flake8
3941

4042
[testenv:docs]
41-
basepython = python3.7
43+
basepython = python3.8
4244
deps =
4345
-rrequirements/requirements-testing.txt
4446
-rrequirements/requirements-optionals.txt
4547
-rrequirements/requirements-documentation.txt
4648
commands =
4749
sphinx-build -W -b html -d docs/_build/doctrees docs docs/_build/html
4850

49-
[testenv:py{37,38,39,310}-django{32,40,41}-drfmaster]
51+
[testenv:py{37,38,39,310}-django32-drfmaster]
52+
ignore_outcome = true
53+
54+
[testenv:py{38,39,310}-django40-drfmaster]
55+
ignore_outcome = true
56+
57+
[testenv:py{38,39,310,311}-django41-drfmaster]
5058
ignore_outcome = true

0 commit comments

Comments
 (0)