Debian Codegraph @

tox.ini

raw
1 [tox]
2 isolated_build = true
3 envlist = {,ci-}py{310,311,312,313,314,315,py3},fuzz,run_self,generate_schema
4
5 [testenv]
6 setenv =
7 PYTHONPATH = {toxinidir}/src
8 PYTHONWARNDEFAULTENCODING = 1
9 skip_install = True
10 # We use `recreate=True` because otherwise, on the second run of `tox -e py`,
11 # the `no_jupyter` tests would run with the jupyter extra dependencies installed.
12 # See https://github.com/psf/black/issues/2367.
13 recreate = True
14 dependency_groups = cov-tests
15 commands =
16 pip install -e .[d]
17 coverage erase
18 pytest tests --run-optional no_jupyter \
19 --numprocesses auto \
20 --cov {posargs}
21 pip install -e .[jupyter]
22 pytest tests --run-optional jupyter \
23 -m jupyter \
24 --numprocesses auto \
25 --cov --cov-append {posargs}
26 coverage report
27
28 [testenv:{,ci-}pypy3]
29 setenv =
30 PYTHONPATH = {toxinidir}/src
31 skip_install = True
32 recreate = True
33 dependency_groups = tests
34 commands =
35 pip install -e .[d]
36 pytest tests --run-optional no_jupyter \
37 --numprocesses auto
38 pip install -e .[jupyter]
39 pytest tests --run-optional jupyter \
40 -m jupyter \
41 --numprocesses auto
42
43 [testenv:fuzz]
44 skip_install = True
45 dependency_groups = fuzz
46 commands =
47 pip install -e .[d]
48 coverage erase
49 coverage run {toxinidir}/scripts/fuzz.py
50 coverage report
51
52 [testenv:run_self]
53 setenv =
54 PYTHONPATH = {toxinidir}/src
55 skip_install = True
56 commands =
57 pip install -e .
58 black --check {toxinidir}
59
60 [testenv:generate_schema]
61 setenv =
62 PYTHONWARNDEFAULTENCODING =
63 skip_install = True
64 commands =
65 pip install -e .
66 python {toxinidir}/scripts/generate_schema.py --outfile {toxinidir}/src/black/resources/black.schema.json