This repository has been archived on 2024-06-20. You can view files and clone it, but you cannot make any changes to it's state, such as pushing and creating new issues, pull requests or comments.
coffee.pygments/tox.ini
2023-11-20 20:37:45 +01:00

92 lines
2.3 KiB
INI

[tox]
envlist = py
[testenv]
description =
run tests with pytest (you can pass extra arguments for pytest,
e.g., "tox -- --update-goldens")
deps =
pytest >= 7.0
pytest-cov
pytest-randomly
wcag-contrast-ratio
commands = pytest {posargs}
use_develop = True
[testenv:regexlint]
description =
lint regular expressions with regexlint
deps =
git+https://github.com/pygments/regexlint.git@master
commands = regexlint pygments.lexers
[testenv:pylint]
description =
lint code with pylint
deps =
pylint
skip_install = True # doesn't need installing Pygments into the venv
commands =
pylint --rcfile scripts/pylintrc pygments
[testenv:check]
description =
miscellaneous checks on the source code, including pyflakes
deps =
ruff
commands =
python scripts/check_crlf.py pygments external
python scripts/detect_missing_analyse_text.py --skip-no-aliases
ruff check .
python scripts/check_sources.py -i pygments/lexers/_mapping.py \
-i pygments/styles/_mapping.py \
-i docs/_build -i pygments/formatters/_mapping.py -i pygments/unistring.py \
-i tests/support/empty.py
python scripts/count_token_references.py --minfiles=1 --maxfiles=1 \
--minlines=1 --maxlines=3 --subtoken
[testenv:mapfiles]
description =
regenerate map files
deps =
commands =
python scripts/gen_mapfiles.py
[testenv:coverage]
description =
run tests, and generate a coverage report in htmlcov/
commands =
pytest --cov --cov-report=html --cov-report=term {posargs}
[testenv:doc]
description =
compile documentation with Sphinx. You can pass a builder name,
like "tox -e doc -- latex". You can also add extra options, like
"SPHINXOPTS='-D latex_paper_size=letter' tox -e doc -- latex".
change_dir = doc
deps =
sphinx
wcag-contrast-ratio
commands =
sphinx-build -b {posargs:html} -n {env:SPHINXOPTS} . _build/{posargs:html}
[testenv:web-doc]
description =
same as doc, but also build the demo by compiling Pygments to WASM.
change_dir = doc
deps = {[testenv:doc]deps}
allowlist_externals =
docker
setenv =
# Enable the BuildKit backend to use the --output option.
DOCKER_BUILDKIT = 1
# Build the demo page.
WEBSITE_BUILD = 1
commands =
docker build --file pyodide/Dockerfile --output _build/pyodide/pyodide ..
sphinx-build -b {posargs:html} {env:SPHINXOPTS} . _build/{posargs:html}