Debian Codegraph @

tox.ini

raw
1 [tox]
2 envlist = py
3
4 [testenv]
5 description =
6 run tests with pytest (you can pass extra arguments for pytest,
7 e.g., "tox -- --update-goldens")
8 deps =
9 pytest ~= 8.2
10 pytest-cov
11 pytest-randomly
12 wcag-contrast-ratio
13 commands = pytest {posargs}
14 use_develop = True
15
16 [testenv:regexlint]
17 description =
18 lint regular expressions with regexlint
19 deps =
20 git+https://github.com/pygments/regexlint.git@master
21 commands = regexlint pygments.lexers
22
23
24 [testenv:pylint]
25 description =
26 lint code with pylint
27 deps =
28 pylint
29 skip_install = True # doesn't need installing Pygments into the venv
30 commands =
31 pylint --rcfile scripts/pylintrc pygments
32
33
34 [testenv:check]
35 description =
36 various checks on the source code, including ruff linting
37 deps =
38 ruff==0.15.2
39 commands =
40 python scripts/check_crlf.py pygments external
41 python scripts/detect_missing_analyse_text.py --skip-no-aliases
42 ruff check --ignore UP031 .
43 python scripts/check_sources.py -i pygments/lexers/_mapping.py \
44 -i pygments/styles/_mapping.py \
45 -i docs/_build -i pygments/formatters/_mapping.py -i pygments/unistring.py \
46 -i tests/support/empty.py
47 python scripts/count_token_references.py --minfiles=1 --maxfiles=1 \
48 --minlines=1 --maxlines=3 --subtoken
49
50 [testenv:mapfiles]
51 description =
52 regenerate map files
53 deps =
54 commands =
55 python scripts/gen_mapfiles.py
56
57
58 [testenv:coverage]
59 description =
60 run tests, and generate a coverage report in htmlcov/
61 commands =
62 pytest --cov --cov-report=html --cov-report=term {posargs}
63
64
65 [testenv:doc]
66 description =
67 compile documentation with Sphinx. You can pass a builder name,
68 like "tox -e doc -- latex". You can also add extra options, like
69 "SPHINXOPTS='-D latex_paper_size=letter' tox -e doc -- latex".
70 change_dir = doc
71 deps =
72 sphinx
73 wcag-contrast-ratio
74 commands =
75 sphinx-build -b {posargs:html} -n {env:SPHINXOPTS} . _build/{posargs:html}
76
77
78 [testenv:web-doc]
79 description =
80 same as doc, but also build the demo by compiling Pygments to WASM.
81 change_dir = doc
82 deps = {[testenv:doc]deps}
83 allowlist_externals =
84 docker
85 setenv =
86 # Enable the BuildKit backend to use the --output option.
87 DOCKER_BUILDKIT = 1
88 # Build the demo page.
89 WEBSITE_BUILD = 1
90 commands =
91 docker build --file pyodide/Dockerfile --output _build/pyodide/pyodide ..
92 sphinx-build -b {posargs:html} {env:SPHINXOPTS} . _build/{posargs:html}