-
Notifications
You must be signed in to change notification settings - Fork 45
/
Copy pathtox.ini
95 lines (83 loc) · 2.2 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
[tox]
envlist = bandit,black,isort,flake8,mypy,python3.11
[gh-actions]
python =
3.11: python3.11
[testenv]
deps =
-rrequirements.txt
-rrequirements-web.txt
-rrequirements-test.txt
allowlist_externals =
make
mkdir
rm
passenv = TOX_ENV_DIR
setenv =
CACHITO_TESTING=true
PROMETHEUS_MULTIPROC_DIR={envtmpdir}/prometheus_metrics
usedevelop = true
commands =
py.test \
--ignore tests/integration \
--cov-config .coveragerc --cov=cachito --cov-report term \
--cov-report xml --cov-report html {posargs}
commands_post =
rm -rf {envtmpdir}/prometheus_metrics
[testenv:black]
description = black checks [Mandatory]
skip_install = true
deps =
# Pin the version of black and click to avoid a newer version causing tox to fail
black==22.6.0
click==8.0.3
commands =
black --check --diff cachito tests
# Use shorter line length for scripts
black --check --diff bin --line-length=88
[testenv:isort]
skip_install = true
# Remove colorama after https://github.com/PyCQA/isort/issues/2211 is released
deps =
isort[colors]
colorama
commands =
isort --check --diff --color cachito tests
[testenv:flake8]
skip_install = true
deps =
flake8==3.9.2
flake8-docstrings==1.6.0
commands =
flake8
[flake8]
show-source = True
max-line-length = 100
exclude = venv,.git,.tox,dist,*egg,cachito/web/migrations,.env
# W503 line break before binary operator
# E203 whitespace before ':' ("black" will catch the valid cases)
ignore = D100,D104,D105,W503,E203
per-file-ignores =
# Ignore missing docstrings in the tests and migrations
tests/*:D101,D102,D103
cachito/web/migrations/*:D103
[testenv:bandit]
skip_install = true
deps =
bandit
commands =
bandit -r cachito
[testenv:mypy]
commands =
pip install mypy # cannot be in deps due requirement of hashes
mypy -p cachito --install-types --non-interactive --ignore-missing-imports
[testenv:integration]
basepython = python3
skipsdist = true
skip_install = true
commands =
pytest -rA -vvvv \
--confcutdir=tests/integration \
{posargs:tests/integration}
passenv = KRB5CCNAME,REQUESTS_CA_BUNDLE,KRB5_CLIENT_KTNAME,CACHITO_TEST_CERT\
CACHITO_TEST_KEY,JOB_NAME