From 479d91b2a10490894c8cd6862a09d1eef7ea38f5 Mon Sep 17 00:00:00 2001 From: Stephen Finucane Date: Thu, 4 Jul 2024 17:54:14 +0100 Subject: [PATCH 1/2] tox: Bump minimum version to 4.x 'isolated_build' is no longer required since builds are isolated by default in tox 4. 'basepython' is no longer required since tox 4 only supports Python 3 and 'basepython' defaults to the version of Python that tox is installed with. Signed-off-by: Stephen Finucane --- tox.ini | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/tox.ini b/tox.ini index 695ba99f7a3..b5bbcc2853e 100644 --- a/tox.ini +++ b/tox.ini @@ -1,7 +1,6 @@ [tox] -minversion = 2.4.0 +minversion = 4.2.0 envlist = py{39,310,311,312,313} -isolated_build = True [testenv] usedevelop = True @@ -30,7 +29,6 @@ commands= python -X dev -X warn_default_encoding -m pytest --durations 25 {posargs} [testenv:docs] -basepython = python3 description = Build documentation. extras = @@ -40,7 +38,6 @@ commands = sphinx-build -M {env:BUILDER:html} ./doc ./build/sphinx -nW --keep-going {posargs} [testenv:docs-live] -basepython = python3 description = Build documentation. extras = From 7da84e92ca773c872169ea55724389a04d0a3255 Mon Sep 17 00:00:00 2001 From: Stephen Finucane Date: Wed, 16 Aug 2023 10:47:53 +0100 Subject: [PATCH 2/2] tox: Add 'lint' target This simply runs the same commands as the GitHub CI workflows. Signed-off-by: Stephen Finucane --- .github/workflows/lint.yml | 2 ++ tox.ini | 16 +++++++++++++++- 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 1c496947fe4..0193fd9be4e 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -16,6 +16,8 @@ env: FORCE_COLOR: "1" jobs: + # If you update any of these commands, don't forget to update the equivalent + # tox environment ruff: runs-on: ubuntu-latest diff --git a/tox.ini b/tox.ini index b5bbcc2853e..8e37493ece6 100644 --- a/tox.ini +++ b/tox.ini @@ -28,6 +28,19 @@ setenv = commands= python -X dev -X warn_default_encoding -m pytest --durations 25 {posargs} +[testenv:lint] +description = + Run linters. +extras = + lint +# If you update any of these commands, don't forget to update the equivalent +# GitHub Workflow step +commands = + ruff . --diff --format github + flake8 . + isort --check-only --diff . + mypy sphinx/ + [testenv:docs] description = Build documentation. @@ -70,4 +83,5 @@ description = extras = lint test -commands = mypy {posargs} +commands = + mypy {posargs}