Skip to content

Commit a6dce84

Browse files
committed
Upgrade to tox v4 (#14579)
1 parent eb2e02d commit a6dce84

File tree

5 files changed

+18
-15
lines changed

5 files changed

+18
-15
lines changed

.github/workflows/docs.yml

+3-3
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@ jobs:
2626
with:
2727
python-version: '3.7'
2828
- name: Install tox
29-
run: pip install --upgrade 'setuptools!=50' tox==3.24.5
29+
run: pip install --upgrade 'setuptools!=50' tox==4.4.4
3030
- name: Setup tox environment
31-
run: tox -e ${{ env.TOXENV }} --notest
31+
run: tox run -e ${{ env.TOXENV }} --notest
3232
- name: Test
33-
run: tox -e ${{ env.TOXENV }} --skip-pkg-install
33+
run: tox run -e ${{ env.TOXENV }} --skip-pkg-install

.github/workflows/test.yml

+6-6
Original file line numberDiff line numberDiff line change
@@ -127,16 +127,16 @@ jobs:
127127
./misc/build-debug-python.sh $PYTHONVERSION $PYTHONDIR $VENV
128128
source $VENV/bin/activate
129129
- name: Install tox
130-
run: pip install --upgrade 'setuptools!=50' tox==3.24.5
130+
run: pip install --upgrade 'setuptools!=50' tox==4.4.4
131131
- name: Compiled with mypyc
132132
if: ${{ matrix.test_mypyc }}
133133
run: |
134134
pip install -r test-requirements.txt
135135
CC=clang MYPYC_OPT_LEVEL=0 MYPY_USE_MYPYC=1 pip install -e .
136136
- name: Setup tox environment
137-
run: tox -e ${{ matrix.toxenv }} --notest
137+
run: tox run -e ${{ matrix.toxenv }} --notest
138138
- name: Test
139-
run: tox -e ${{ matrix.toxenv }} --skip-pkg-install -- ${{ matrix.tox_extra_args }}
139+
run: tox run -e ${{ matrix.toxenv }} --skip-pkg-install -- ${{ matrix.tox_extra_args }}
140140

141141
python-nightly:
142142
runs-on: ubuntu-latest
@@ -147,11 +147,11 @@ jobs:
147147
with:
148148
python-version: '3.12-dev'
149149
- name: Install tox
150-
run: pip install --upgrade 'setuptools!=50' tox==3.24.5
150+
run: pip install --upgrade 'setuptools!=50' tox==4.4.4
151151
- name: Setup tox environment
152-
run: tox -e py --notest
152+
run: tox run -e py --notest
153153
- name: Test
154-
run: tox -e py --skip-pkg-install -- "-n 2"
154+
run: tox run -e py --skip-pkg-install -- "-n 2"
155155
continue-on-error: true
156156
- name: Mark as a success
157157
run: exit 0

CONTRIBUTING.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -53,13 +53,13 @@ python3 runtests.py
5353

5454
You can also use `tox` to run tests (`tox` handles setting up the test environment for you):
5555
```
56-
tox -e py
56+
tox run -e py
5757
5858
# Or some specific python version:
59-
tox -e py39
59+
tox run -e py39
6060
6161
# Or some specific command:
62-
tox -e lint
62+
tox run -e lint
6363
```
6464

6565
Some useful commands for running specific tests include:

docs/source/existing_code.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ A simple CI script could look something like this:
5151
python3 -m pip install mypy==0.971
5252
# Run your standardised mypy invocation, e.g.
5353
mypy my_project
54-
# This could also look like `scripts/run_mypy.sh`, `tox -e mypy`, `make mypy`, etc
54+
# This could also look like `scripts/run_mypy.sh`, `tox run -e mypy`, `make mypy`, etc
5555
5656
Ignoring errors from certain modules
5757
------------------------------------

tox.ini

+5-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[tox]
2-
minversion = 3.8.0
2+
minversion = 4.4.4
33
skip_missing_interpreters = {env:TOX_SKIP_MISSING_INTERPRETERS:True}
44
envlist =
55
py37,
@@ -30,7 +30,10 @@ commands =
3030

3131
[testenv:type]
3232
description = type check ourselves
33-
passenv = TERM MYPY_FORCE_COLOR MYPY_FORCE_TERMINAL_WIDTH
33+
passenv =
34+
TERM
35+
MYPY_FORCE_COLOR
36+
MYPY_FORCE_TERMINAL_WIDTH
3437
commands =
3538
python -m mypy --config-file mypy_self_check.ini -p mypy -p mypyc
3639
python -m mypy --config-file mypy_self_check.ini misc --exclude misc/fix_annotate.py --exclude misc/async_matrix.py --exclude misc/sync-typeshed.py

0 commit comments

Comments
 (0)