Skip to content

Commit bced614

Browse files
committed
Update tox config to avoid cycle on coverage envs
The `depends` cycle detection in `tox` was flagging the combined `coverage,coverage-clean` testenv. To avoid, break this back into two separate testenvs. Also, add descriptions to all testenvs.
1 parent b964346 commit bced614

File tree

1 file changed

+22
-10
lines changed

1 file changed

+22
-10
lines changed

tox.ini

Lines changed: 22 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,16 @@ labels =
88
ci = py, py-format, py-json5, py-json5-format, py-pyjson5, py-pyjson5-format, py-tomli, py-tomli-format, coverage
99

1010
envlist =
11-
cov-{clean,combine,report}
11+
cov_clean
1212
py{311,310,39,38,37}
1313
py{37,310}-{tomli}{,-format}
1414
py{37,311}-{json5,pyjson5}
15+
cov
1516
skip_missing_interpreters = true
16-
minversion = 3.0.0
17+
minversion = 4.0.0
1718

1819
[testenv]
20+
description = "run tests with pytest"
1921
usedevelop = true
2022
extras = dev
2123
deps =
@@ -25,25 +27,31 @@ deps =
2527
format: jsonschema[format]
2628
commands = coverage run -m pytest {posargs}
2729
depends =
28-
py{,37,38,39,310,311}{,-json5,-pyjson5,-tomli}: coverage-clean
29-
coverage: py{,37,38,39,310,311}{,-json5,-pyjson5,-tomli}
30+
py{,37,38,39,310,311}{,-json5,-pyjson5,-tomli}: cov_clean
31+
cov: py{,37,38,39,310,311}{,-json5,-pyjson5,-tomli}
3032

31-
[testenv:coverage{,-clean}]
33+
[testenv:cov_clean]
34+
description = "erase coverage data to prepare for a new run"
3235
deps = coverage
3336
skip_install = true
34-
commands_pre =
35-
!clean: coverage combine
36-
commands =
37-
clean: coverage erase
38-
!clean: coverage report --skip-covered
37+
commands = coverage erase
38+
39+
[testenv:cov]
40+
description = "combine and report coverage data"
41+
deps = coverage
42+
skip_install = true
43+
commands_pre = coverage combine
44+
commands = coverage report --skip-covered
3945

4046
[testenv:mypy]
47+
description = "check type annotations with mypy"
4148
deps = mypy
4249
types-jsonschema
4350
types-requests
4451
commands = mypy src/ {posargs}
4552

4653
[testenv:docs]
54+
description = "build docs with sphinx"
4755
basepython = python3.10
4856
extras = docs
4957
allowlist_externals = rm
@@ -53,6 +61,7 @@ commands_pre = rm -rf _build/
5361
commands = sphinx-build -d _build/doctrees -b dirhtml -W . _build/dirhtml {posargs}
5462

5563
[testenv:twine-check]
64+
description = "check the metadata on a package build"
5665
skip_install = true
5766
deps = twine
5867
build
@@ -63,13 +72,16 @@ commands = python -m build
6372
twine check dist/*
6473

6574
[testenv:vendor-schemas]
75+
description = "update the vendored schemas"
6676
deps = pre-commit
6777
commands = python ./scripts/vendor-schemas.py
6878

6979
[testenv:generate-hooks-config]
80+
description = "update autogenerated pre-commit hooks"
7081
commands = python ./scripts/generate-hooks-config.py
7182

7283
[testenv:publish-release]
84+
description = "build and publish to pypi"
7385
skip_install = true
7486
deps = twine
7587
build

0 commit comments

Comments
 (0)