-
Notifications
You must be signed in to change notification settings - Fork 19
Expand file tree
/
Copy pathtox.ini
More file actions
150 lines (130 loc) · 3.47 KB
/
Copy pathtox.ini
File metadata and controls
150 lines (130 loc) · 3.47 KB
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
137
138
139
140
141
142
143
144
145
146
147
148
149
150
[tox]
envlist =
clean
py{310,311}-django{52}
py{312,313,314}-django{52,61}
coverage-html
skipsdist = True
skip_missing_interpreters = True
basepython = python3.12
[gh-actions]
python =
3.10: py310
3.11: py311
3.12: py312
3.13: py313
3.14: py314
[testenv:clean]
deps =
coverage
setenv =
commands =
-coverage erase
[testenv:coverage-html]
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
PIP_BUILD_CONSTRAINT=constraints.txt
commands =
pip-compile --no-strip-extras --resolver backtracking --output-file requirements-django52.txt {posargs} pyproject.toml requirements/django52.txt constraints.txt
pip-compile --no-strip-extras --resolver backtracking --output-file requirements-django61.txt {posargs} pyproject.toml requirements/django61.txt constraints.txt
cp requirements-django52.txt requirements.txt
[testenv:tailwind]
setenv =
TAILWINDDIR=src/argus/htmx/tailwindtheme
STATICDIR=src/argus/htmx
allowlist_externals =
tailwindcss
commands =
tailwindcss -i {env:TAILWINDDIR}/styles.css -o {env:STATICDIR}/static/styles.css
[testenv:generate-er-model]
setenv =
deps =
-r requirements-django52.txt
-r requirements/dev.txt
commands =
python manage.py graph_models argus_auth argus_incident argus_notificationprofile argus_plannedmaintenance django_tasks_database --group-models -X AbstractUser,AbstractBaseUser,Permission,PermissionsMixin -o docs/reference/img/ER_model.png
[testenv:coverage-xml]
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-django52.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:django-warnings]
description = Fail if Django produces warnings at or above the configured level
deps =
-r requirements/dev.txt
-r requirements-django52.txt
setenv =
DJANGO_SETTINGS_MODULE = argus.site.settings.dev
allowlist_externals =
make
commands_pre =
make setup-tailwind
commands =
python manage.py check --fail-level=ERROR
[testenv]
passenv = DATABASE_URL
deps =
coverage
unittest-xml-reporting
-r requirements-django{env:DJANGO_VER}.txt
setenv =
PYTHONDONTWRITEBYTECODE=1
PIP_CONSTRAINT=constraints.txt
LC_ALL=C.UTF-8
LANG=C.UTF-8
PYTHONPATH = {toxinidir}/src
PYTHONWARNINGS=once::DeprecationWarning
django52: DJANGO_VER=52
django61: DJANGO_VER=61
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