-
Notifications
You must be signed in to change notification settings - Fork 14
/
Copy pathtox.ini
136 lines (118 loc) · 3.26 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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
[tox]
envlist =
clean
py39-django{42}
py{310,311,312}-django{42,50,51}
coverage-html
skipsdist = True
skip_missing_interpreters = True
basepython = python3.10
[gh-actions]
python =
3.9: py39
3.10: py310
3.11: py311
3.12: py312
[testenv:clean]
deps =
coverage
setenv =
commands =
-coverage erase
[testenv:coverage-html]
basepython = python3.10
deps =
coverage
setenv =
commands =
-coverage combine --append
coverage html --include="./src/*" --omit="*/admin.py,*/test*,*/migrations/*"
[testenv:ruff-critical]
setenv =
deps =
ruff
commands =
# stop the build if there are Python syntax errors or undefined names
ruff check --output-format=full --select=E9,F63,F7,F82 --statistics src/
[testenv:ruff-reformat]
setenv =
deps =
ruff
commands =
ruff format
[testenv:upgrade-deps]
allowlist_externals = cp
deps =
pip-tools
setenv =
PIP_CONSTRAINT=constraints.txt
commands =
pip-compile --resolver backtracking --output-file requirements-django42.txt {posargs} pyproject.toml requirements/django42.txt requirements/htmx.txt constraints.txt
pip-compile --resolver backtracking --output-file requirements-django50.txt {posargs} pyproject.toml requirements/django50.txt requirements/htmx.txt constraints.txt
pip-compile --resolver backtracking --output-file requirements-django51.txt {posargs} pyproject.toml requirements/django51.txt requirements/htmx.txt constraints.txt
cp requirements-django42.txt requirements.txt
[testenv:tailwind]
setenv =
TAILWINDDIR=src/argus/htmx/tailwindtheme
STATICDIR=src/argus/htmx
allowlist_externals =
tailwindcss
commands =
tailwindcss -c {env:TAILWINDDIR}/tailwind.config.js -i {env:TAILWINDDIR}/styles.css --output {env:STATICDIR}/static/styles.css
[testenv:generate-er-model]
setenv =
deps =
-r requirements-django42.txt
-r requirements/dev.txt
commands =
python manage.py graph_models argus_auth argus_incident argus_notificationprofile --group-models -X AbstractUser,AbstractBaseUser,Permission,PermissionsMixin -o docs/reference/img/ER_model.png
[testenv:coverage-xml]
basepython = python3.10
deps =
coverage
setenv =
commands_pre =
commands =
-coverage combine --append
coverage xml --include="./src/*" --omit="*/admin.py,*/test*,*/migrations/*"
[testenv:docs]
description = Build the Sphinx documentation
deps =
-r requirements/dev.txt
-r requirements-django42.txt
package = editable
setenv =
DJANGO_SETTINGS_MODULE = argus.site.settings.base
LC_ALL=C.UTF-8
LANG=C.UTF-8
VIRTUALENV_PIP=23.1.0
commands_pre =
commands =
sphinx-build -M html docs/ docs/_build/
[testenv]
passenv = DATABASE_URL
deps =
coverage
unittest-xml-reporting
-r requirements-django{env:DJANGO_VER}.txt
setenv =
PIP_CONSTRAINT=constraints.txt
LC_ALL=C.UTF-8
LANG=C.UTF-8
PYTHONPATH = {toxinidir}/src
PYTHONWARNINGS=once::DeprecationWarning
django42: DJANGO_VER=42
django50: DJANGO_VER=50
django51: DJANGO_VER=51
commands =
coverage run -p manage.py test -v 2 --settings=argus.site.settings.test_CI {posargs}
[coverage:run]
source = ./src/.
omit =
migrations,
admin.py,
test*
[coverage:report]
exclude_lines =
# Ignore not abstract methods, as these cannot be tested
raise NotImplementedError