-
Notifications
You must be signed in to change notification settings - Fork 9
/
tox.ini
101 lines (82 loc) · 2.59 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
[tox]
envlist = secrets,migrations,black,flake8,bandit,schema,isort
skipsdist = true
[testenv]
passenv = *
basepython = python3.9
setenv =
OSIDB_DEBUG = 1
DJANGO_SETTINGS_MODULE=config.settings_local
DJANGO_SECRET_KEY = local
# the --no-deps flag tells pip not to install package dependencies, this is OK
# because we use pip-tools to create an explicit whitelist of all dependencies
# used by the project, both direct and indirect,and it's a workaround to a pip
# bug (https://github.com/pypa/pip/issues/9644)
deps = --no-deps
-rrequirements.txt
-rdevel-requirements.txt
[testenv:unit-tests]
commands =
pytest -m "unit" {posargs}
[testenv:integration-tests]
commands =
pytest -m "integration" {posargs}
[testenv:tests]
commands =
pytest {posargs}
[testenv:record-new]
commands =
pytest --record-mode=once {posargs}
[testenv:record-rewrite]
commands =
pytest --record-mode=rewrite {posargs}
[testenv:krb5-auth]
commands =
pytest krb5_auth/
[testenv:rls]
deps = -rdevel-requirements.txt
-rrequirements.txt
commands =
pytest osidb/tests/test_rls.py
[testenv:ci-osidb]
setenv =
OSIDB_DEBUG = 1
DJANGO_SETTINGS_MODULE=config.settings_ci
DJANGO_SECRET_KEY = ci
commands =
pytest
[testenv:flake8]
deps = flake8==6.1.0
flake8-django==1.4
commands = flake8 osidb collectors apps
[flake8]
# E203 - whitespace before ':' -- ignored per Black documentation, non PEP8-compliant
# E501 - line too long, let black take care of that
extend-ignore = E203,E501
exclude = .git/,venv/,.tox/,src/prodsec,scripts/src,migrations
jobs = 4
max-line-length=88
[testenv:black]
deps = black==22.12.0
commands = black --extend-exclude ^.*\b(migrations)\b.*$ --check .
[testenv:bandit]
deps = bandit==1.7.5
commands = bandit -x osidb/tests,collectors/bzimport/tests,collectors/jiraffe/tests,apps/sla/tests,apps/workflows/tests --ini .bandit -r osidb collectors apps
[testenv:mypy]
commands = mypy --html-report mypyreport --config-file .mypy.ini --exclude "^.*\b(migrations)\b.*$" --exclude "^.*\b(tests)\b.*$" osidb/ collectors/ apps/
[testenv:secrets]
deps = detect-secrets==1.4.0
allowlist_externals = bash
commands = /usr/bin/bash -c 'detect-secrets-hook --baseline .secrets.baseline $(git ls-files)'
[testenv:migrations]
allowlist_externals = bash
commands = /usr/bin/bash -c './scripts/migrations-check.sh'
[testenv:schema]
allowlist_externals = bash
commands = /usr/bin/bash -c './scripts/schema-check.sh'
[isort]
profile = black
skip = migrations,venv,.tox,src,attic
[testenv:isort]
deps = isort==5.12.0
commands = isort --diff --check .