forked from containerbuildsystem/cachito
-
Notifications
You must be signed in to change notification settings - Fork 0
/
tox.ini
85 lines (76 loc) · 2.06 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
[tox]
envlist = bandit,black,flake8,mypy,py38,py39
[gh-actions]
python =
3.8: py38
3.9: py39
[testenv]
deps =
-rrequirements-test.txt
whitelist_externals =
make
passenv = TOX_ENV_DIR
setenv =
CACHITO_TESTING=true
usedevelop = true
commands =
py.test -vvv \
--ignore tests/integration \
--cov-config .coveragerc --cov=cachito --cov-report term \
--cov-report xml --cov-report html {posargs}
[testenv:black]
# a bug in python3.9 is causing occasional failures: https://bugs.python.org/issue43498,
# after this is fixed, basepython can be removed
basepython = python3.8
description = black checks [Mandatory]
skip_install = true
deps =
# Pin the version of black to avoid a newer version causing tox to fail
black==19.10b0
commands =
black --check --diff cachito tests
# Use shorter line length for scripts
black --check --diff bin --line-length=88
[testenv:flake8]
skip_install = true
deps =
flake8==3.9.2
flake8-docstrings==1.6.0
flake8-isort==4.0.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
[isort]
line_length = 100
# Vertical hanging indent
multi_line_output = 3
include_trailing_comma = true
[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 -vvv \
--confcutdir=tests/integration \
{posargs:tests/integration}
passenv = KRB5CCNAME REQUESTS_CA_BUNDLE KRB5_CLIENT_KTNAME CACHITO_TEST_CERT CACHITO_TEST_KEY JOB_NAME