-
Notifications
You must be signed in to change notification settings - Fork 0
/
tox.ini
66 lines (58 loc) · 1.72 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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
[tox]
skipsdist = true
skip_install = true
envlist = py37, py38, py39, lint, docs
[testenv]
description = Install our own package (using poetry) and run pytest
whitelist_externals =
echo
poetry
list_dependencies_command = echo
commands =
poetry install -v
poetry run pytest {posargs}
[testenv:lint]
description = Lint the code
# Reuse the environment created by py39
envdir = {toxworkdir}/py39
commands =
poetry run black src tests
poetry run flake8 src tests
poetry run isort --check-only src tests
poetry run mypy src
[testenv:docs]
description = Invoke sphinx-build to build the HTML docs
# Reuse the environment created by py37
envdir = {toxworkdir}/py37
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"))'
[pytest]
addopts = --doctest-modules --cov-report term-missing:skip-covered --cov=src
doctest_optionflags = NORMALIZE_WHITESPACE
[flake8]
max-line-length = 88
extend-ignore = "E203"
[gh-actions]
# This is used when running tox from a GitHub action
# For each python version, run a selection of environments
python =
3.7: py37, docs
3.8: py38
3.9: py39, lint
[coverage:report]
exclude_lines =
if __name__ == .__main__.:
[testenv:clean]
skip_install = true
whitelist_externals =
echo
rm
find
make
commands =
rm -rf .tox .pytest_cache .coverage
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 "\{\}" +
make -C docs clean