Skip to content

Commit

Permalink
Upgrade to tox v4 (#14579)
Browse files Browse the repository at this point in the history
  • Loading branch information
hauntsaninja committed Feb 3, 2023
1 parent eb2e02d commit a6dce84
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 15 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ jobs:
with:
python-version: '3.7'
- name: Install tox
run: pip install --upgrade 'setuptools!=50' tox==3.24.5
run: pip install --upgrade 'setuptools!=50' tox==4.4.4
- name: Setup tox environment
run: tox -e ${{ env.TOXENV }} --notest
run: tox run -e ${{ env.TOXENV }} --notest
- name: Test
run: tox -e ${{ env.TOXENV }} --skip-pkg-install
run: tox run -e ${{ env.TOXENV }} --skip-pkg-install
12 changes: 6 additions & 6 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -127,16 +127,16 @@ jobs:
./misc/build-debug-python.sh $PYTHONVERSION $PYTHONDIR $VENV
source $VENV/bin/activate
- name: Install tox
run: pip install --upgrade 'setuptools!=50' tox==3.24.5
run: pip install --upgrade 'setuptools!=50' tox==4.4.4
- name: Compiled with mypyc
if: ${{ matrix.test_mypyc }}
run: |
pip install -r test-requirements.txt
CC=clang MYPYC_OPT_LEVEL=0 MYPY_USE_MYPYC=1 pip install -e .
- name: Setup tox environment
run: tox -e ${{ matrix.toxenv }} --notest
run: tox run -e ${{ matrix.toxenv }} --notest
- name: Test
run: tox -e ${{ matrix.toxenv }} --skip-pkg-install -- ${{ matrix.tox_extra_args }}
run: tox run -e ${{ matrix.toxenv }} --skip-pkg-install -- ${{ matrix.tox_extra_args }}

python-nightly:
runs-on: ubuntu-latest
Expand All @@ -147,11 +147,11 @@ jobs:
with:
python-version: '3.12-dev'
- name: Install tox
run: pip install --upgrade 'setuptools!=50' tox==3.24.5
run: pip install --upgrade 'setuptools!=50' tox==4.4.4
- name: Setup tox environment
run: tox -e py --notest
run: tox run -e py --notest
- name: Test
run: tox -e py --skip-pkg-install -- "-n 2"
run: tox run -e py --skip-pkg-install -- "-n 2"
continue-on-error: true
- name: Mark as a success
run: exit 0
6 changes: 3 additions & 3 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,13 +53,13 @@ python3 runtests.py

You can also use `tox` to run tests (`tox` handles setting up the test environment for you):
```
tox -e py
tox run -e py
# Or some specific python version:
tox -e py39
tox run -e py39
# Or some specific command:
tox -e lint
tox run -e lint
```

Some useful commands for running specific tests include:
Expand Down
2 changes: 1 addition & 1 deletion docs/source/existing_code.rst
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ A simple CI script could look something like this:
python3 -m pip install mypy==0.971
# Run your standardised mypy invocation, e.g.
mypy my_project
# This could also look like `scripts/run_mypy.sh`, `tox -e mypy`, `make mypy`, etc
# This could also look like `scripts/run_mypy.sh`, `tox run -e mypy`, `make mypy`, etc
Ignoring errors from certain modules
------------------------------------
Expand Down
7 changes: 5 additions & 2 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[tox]
minversion = 3.8.0
minversion = 4.4.4
skip_missing_interpreters = {env:TOX_SKIP_MISSING_INTERPRETERS:True}
envlist =
py37,
Expand Down Expand Up @@ -30,7 +30,10 @@ commands =

[testenv:type]
description = type check ourselves
passenv = TERM MYPY_FORCE_COLOR MYPY_FORCE_TERMINAL_WIDTH
passenv =
TERM
MYPY_FORCE_COLOR
MYPY_FORCE_TERMINAL_WIDTH
commands =
python -m mypy --config-file mypy_self_check.ini -p mypy -p mypyc
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
Expand Down

0 comments on commit a6dce84

Please sign in to comment.