This repository has been archived by the owner on Oct 24, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
tox.ini
69 lines (58 loc) · 1.98 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
67
68
69
[tox]
skipsdist=True
envlist = lint, test, coverage, docs
[testenv]
setenv =
BEV_USER_CONFIG_PATH = ../dev-environment/test-settings.ini
changedir = backend
deps =
-rbackend/requirements-test.txt
passenv = *
[testenv:lint]
commands =
black --check --diff .
flake8 .
pydocstyle .
deps =
black
flake8
pydocstyle
[testenv:test]
commands =
python manage.py makemigrations
pytest --cov=core --cov=bevillingsplatform --cov=core.management.commands {posargs}
[testenv:coverage]
commands =
coverage report --fail-under=90
coverage html -d {toxworkdir}/htmlcov/
python -c 'import pathlib; print("coverage report is available under file://\{0\}".format(pathlib.Path(r"{toxworkdir}") / "htmlcov" / "index.html"))'
[testenv:docs]
setenv =
BEV_USER_CONFIG_PATH = {toxworkdir}/../dev-environment/test-settings.ini
PATH={toxinidir}/node_modules/.bin{:}{envbindir}{:}{env:PATH}
changedir=docs
whitelist_externals =
env
commands =
env PATH={env:PATH} sphinx-build -d "{toxworkdir}/docs_doctree" ../docs/source/ "{toxworkdir}/docs_out" --color -bhtml {posargs}
python -c 'import pathlib; print("documentation available under file://\{0\}".format(pathlib.Path(r"{toxworkdir}") / "docs_out" / "index.html"))'
deps =
-rbackend/requirements-test.txt
[testenv:graph]
whitelist_externals =
dot
bash
commands =
bash -c 'python manage.py graph_models core > OS2BOS.dot'
bash -c 'dot -Tpng OS2BOS.dot > {toxworkdir}/../backend/docs/graphics/OS2BOS_datamodel.png'
python -c 'import pathlib; print("OS2BOS data model is available under file://\{0\}".format(pathlib.Path(r"{toxworkdir}") / ".." / "backend" / "docs" / "graphics" / "OS2BOS_datamodel.png"))'
deps =
-rbackend/requirements-test.txt
[flake8]
# read by flake8 in place of .flake8 file
exclude = */data/*,*/migrations/*,manage.py
[pytest]
DJANGO_SETTINGS_MODULE = bevillingsplatform.settings
[pydocstyle]
match-dir = ^(?!.*(migrations|tests|data|management)).*$
add-ignore = D105,D106