-
Notifications
You must be signed in to change notification settings - Fork 23
/
tox.ini
143 lines (124 loc) · 3.04 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
137
138
139
140
141
[tox]
min_version = 4.0
skip_missing_interpreters = true
envlist = black,docs,flake8,py312,py312,safety,yamllint,bandit, mypy
downloadcache = {toxworkdir}/_download/
labels =
test = unit_tests
static = black, flake8, yamllint, mypy
security = bandit
docs = docs
[gh-actions]
python =
3.12: py312, black, flake8, mypy, yamllint, bandit, safety, docs, unit_tests
3.13: py312, black, flake8, mypy, yamllint, bandit, safety, docs, unit_tests
[testenv]
usedevelop = true
# 3.12 is the current supported version on RHEL 8.10
basepython =
py312: python3.12
py313: python3.13
migrate-db: python3.12
pip-compile: python3.12
setenv =
IIB_TESTING=true
pytest_command =
pytest -vv \
--capture=sys --cov-config .coveragerc --cov=iib --cov-report term \
--cov-report xml --cov-report html {posargs}
[testenv:black]
description = black checks [Mandatory]
skip_install = true
deps =
black==22.3.0
commands =
black --check --diff iib tests
[testenv:docs]
description = build docs [Mandatory]
skip_install = true
deps =
-r docs/requirements.txt
commands =
sphinx-build -W -E docs "{toxworkdir}/docs_out"
[testenv:flake8]
description = PEP8 checks [Mandatory]
skip_install = true
deps =
flake8==3.7.9
flake8-docstrings==1.5.0
commands =
flake8
[testenv:yamllint]
description = YAML checks [Mandatory]
skip_install = true
deps =
yamllint==1.24.2
commands =
yamllint .
[testenv:py312]
description = Python 3.12 unit tests [Mandatory]
commands =
{[testenv]pytest_command}
deps =
-rrequirements-test.txt
[testenv:py313]
description = Python 3.13 unit tests
commands =
{[testenv]pytest_command}
deps =
-rrequirements-test.txt
[testenv:unit_tests]
description = Python unit tests [Mandatory]
commands =
{[testenv]pytest_command}
deps =
-rrequirements-test.txt
[testenv:safety]
description = dependency vulnerability checks [Mandatory]
skip_install = true
deps =
safety
commands =
safety check -r requirements.txt
[testenv:bandit]
description = static application security testing [Mandatory]
skip_install = true
deps =
bandit
commands =
bandit -ll -r .
[testenv:mypy]
description = type check iib
skip_install = true
deps =
mypy
types-retry
types-requests
commands =
mypy --ignore-missing-imports ./iib
[flake8]
ignore = D100,D104,D105,W503
max-line-length = 100
per-file-ignores =
# Ignore missing docstrings in the tests and migrations
tests/*:D103
iib/web/migrations/*:D103
[pytest]
log_level = NOTSET
[testenv:migrate-db]
description = helper function for migrating databases
deps =
-rrequirements-test.txt
setenv =
FLASK_APP=iib/web/app.py
commands =
flask db stamp head
flask db upgrade
flask db migrate -m {posargs}
[testenv:pip-compile]
description = helper function to regenerate requirements files
skip_install = true
deps = pip-tools
commands =
pip-compile --generate-hashes --output-file=requirements.txt {posargs}
pip-compile --generate-hashes --output-file=requirements-test.txt requirements-test.in {posargs}