-
Notifications
You must be signed in to change notification settings - Fork 10
/
tox.ini
37 lines (33 loc) · 1.28 KB
/
tox.ini
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
# tox (https://tox.readthedocs.io/) is a tool for running tests
# in multiple virtualenvs. This configuration file will run the
# test suite on all supported python versions. To use it, "pip install tox"
# and then run "tox" from this directory.
[tox]
envlist = py38, py39, py310, docs
isolated_build = True
[testenv]
description = Run pytest
whitelist_externals = poetry
commands = poetry install --remove-untracked
poetry run pytest {posargs}
[testenv:docs]
description = Invoke sphinx-build to build the HTML docs
# Reuse the environment created by py310
envdir = {toxworkdir}/py310
commands =
poetry run sphinx-build -d "{toxworkdir}/docs_doctree" docs "{toxworkdir}/docs_out" --color -W -bhtml {posargs}
python -c 'import pathlib; print("Documentation is now available under file://\{0\}".format(pathlib.Path(r"{toxworkdir}") / "docs_out" / "index.html"))'
[testenv:clean]
description = Delete all auto-generated files
skip_install = true
whitelist_externals =
echo
rm
find
make
commands =
rm -rf .tox .pytest_cache .coverage
find . -type f -name "*.pyc" -exec rm -rf "\{\}" +
find . -type d -name __pycache__ -exec rm -rf "\{\}" +
find . -type d -name "*.egg-info" -exec rm -rf "\{\}" +
find . -type d -name ".mypy_cache" -exec rm -rf "\{\}" +