From 640ca4d5817a120605ae2633482309f2bf20eff8 Mon Sep 17 00:00:00 2001 From: Jim Garrison Date: Sat, 19 Feb 2022 09:24:46 -0500 Subject: [PATCH] Fix {black,lint} environment re-creation on tox4 I've found that the existing tox configuration, which has the black and lint environments sharing the same `envdir`, works fine on tox3 but on tox4 results in the environments being re-created every time one toggles between them. There is a suggested solution [on StackOverflow](https://stackoverflow.com/a/64060423), but it seems not to work as expected on tox4, so I've opened an issue there: https://github.com/tox-dev/tox/issues/2362 I'll plan to merge this PR once the above issue with tox is resolved. --- tox.ini | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) diff --git a/tox.ini b/tox.ini index 0a178d7..d84bdc1 100644 --- a/tox.ini +++ b/tox.ini @@ -1,5 +1,5 @@ [tox] -minversion = 2.1 +minversion = 3.15 envlist = py37, py38, py39, py310, lint, coverage skipsdist = true @@ -17,17 +17,14 @@ commands = python -m pytest -v --doctest-modules treon docs --threads 2 -[testenv:lint] -envdir = .tox/lint +[testenv:{black,lint}] +envdir = {toxworkdir}/lint commands = - black --check {posargs} . - pylint -rn prototype_template tests - nbqa pylint docs/ - mypy . - -[testenv:black] -envdir = .tox/lint -commands = black {posargs} . + black: black {posargs} . + lint: black --check {posargs} . + lint: pylint -rn prototype_template tests + lint: nbqa pylint docs/ + lint: mypy . [testenv:coverage] basepython = python3