Upgrade to tox 4 (#8795)

This commit is contained in:
Adam Johnson 2022-12-08 08:01:07 +00:00 committed by GitHub
parent 1355890f9f
commit 59ae95b22f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 19 additions and 20 deletions

View File

@ -34,18 +34,24 @@ jobs:
run: python -m pip install --upgrade pip setuptools virtualenv wheel run: python -m pip install --upgrade pip setuptools virtualenv wheel
- name: Install dependencies - name: Install dependencies
run: python -m pip install --upgrade codecov tox tox-py run: python -m pip install --upgrade codecov tox
- name: Install tox-py
if: ${{ matrix.python-version == '3.6' }}
run: python -m pip install --upgrade tox-py
- name: Run tox targets for ${{ matrix.python-version }} - name: Run tox targets for ${{ matrix.python-version }}
if: ${{ matrix.python-version != '3.6' }}
run: tox run -f py$(echo ${{ matrix.python-version }} | tr -d .)
- name: Run tox targets for ${{ matrix.python-version }}
if: ${{ matrix.python-version == '3.6' }}
run: tox --py current run: tox --py current
- name: Run extra tox targets - name: Run extra tox targets
if: ${{ matrix.python-version == '3.9' }} if: ${{ matrix.python-version == '3.9' }}
run: | run: |
python setup.py bdist_wheel
rm -r djangorestframework.egg-info # see #6139
tox -e base,dist,docs tox -e base,dist,docs
tox -e dist --installpkg ./dist/djangorestframework-*.whl
- name: Upload coverage - name: Upload coverage
run: | run: |

25
tox.ini
View File

@ -1,20 +1,13 @@
[tox] [tox]
envlist = envlist =
{py36,py37,py38,py39}-django30, {py36,py37,py38,py39}-django30
{py36,py37,py38,py39}-django31, {py36,py37,py38,py39}-django31
{py36,py37,py38,py39,py310}-django32, {py36,py37,py38,py39,py310}-django32
{py38,py39,py310}-{django40,django41,djangomain}, {py38,py39,py310}-{django40,django41,djangomain}
{py311}-{django41,djangomain}, {py311}-{django41,djangomain}
base,dist,docs, base
dist
[travis:env] docs
DJANGO =
3.0: django30
3.1: django31
3.2: django32
4.0: django40
4.1: django41
main: djangomain
[testenv] [testenv]
commands = python -W error::DeprecationWarning -W error::PendingDeprecationWarning runtests.py --coverage {posargs} commands = python -W error::DeprecationWarning -W error::PendingDeprecationWarning runtests.py --coverage {posargs}
@ -39,7 +32,7 @@ deps =
-rrequirements/requirements-testing.txt -rrequirements/requirements-testing.txt
[testenv:dist] [testenv:dist]
commands = ./runtests.py --no-pkgroot --staticfiles {posargs} commands = python -W error::DeprecationWarning -W error::PendingDeprecationWarning runtests.py --no-pkgroot --staticfiles {posargs}
deps = deps =
django django
-rrequirements/requirements-testing.txt -rrequirements/requirements-testing.txt