-
Notifications
You must be signed in to change notification settings - Fork 23
/
tox.ini
96 lines (85 loc) · 2.81 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
# Tox (http://tox.testrun.org/) is a tool for running tests
# in multiple virtualenvs. This configuration file will run the
# test suite on all supported python versions. To use it, "pip install tox"
# and then run "tox" from this directory.
[tox]
envlist = bandit, docs, flake8, black, mypy, py312
ignore_base_python_conflict = True
[testenv]
basepython = python3
download = true
setenv =
FRESHMAKER_TESTING_ENV = 1
VIRTUALENV_PIP = 23.3.1
VIRTUALENV_SETUPTOOLS = 69.0.2
usedevelop = true
skip_install = false
deps =
-r{toxinidir}/test-requirements.txt
commands =
python3 -m pytest \
-W "ignore::UserWarning:flask.sessions" \
-W "ignore:You do not have a working installation:UserWarning" \
-W "ignore:inspect.getargspec:DeprecationWarning" \
-W "ignore:This method will be removed in future versions. Use 'parser.read_file()':DeprecationWarning" \
-W "ignore:Use .persist_selectable:DeprecationWarning" \
{posargs}
[testenv:flake8]
basepython = python3
skip_install = true
deps = flake8
commands = flake8
[testenv:black]
basepython = python3
deps = black
commands = black --line-length 100 --check . \
--extend-exclude="dev_scripts\/|freshmaker\/migrations\/|\.tox\/|build\/|__pycache__|scripts\/print_handlers_md\.py|\.copr\/|\.env"
[testenv:black-format]
basepython = python3
deps = black
commands = black --line-length 100 {posargs:.} \
--extend-exclude="dev_scripts\/|freshmaker\/migrations\/|\.tox\/|build\/|__pycache__|scripts\/print_handlers_md\.py|\.copr\/|\.env"
[testenv:mypy]
description = type check
deps =
mypy==1.1.1
commands =
mypy --ignore-missing-imports --exclude freshmaker/migrations freshmaker tests --install-types --non-interactive
[testenv:bandit]
basepython = python3
skip_install = true
deps = bandit
allowlist_externals = /bin/bash
commands =
; 0.0.0.0 is set in BaseConfiguration, which is ok for local dev and it
; will be replace with a specific host IP when deploy to a server. So, it
; works to ignore B104.
/bin/bash -c "bandit -r -s B104 -ll $(find . -mindepth 1 -maxdepth 1 ! -name tests ! -name \.\* -type d -o -name \*.py)"
ignore_outcome = True
[flake8]
skip_install = true
ignore = E501,E731,W503,W504,E203
exclude = dev_scripts/*,freshmaker/migrations/*,.tox/*,build/*,__pycache__,scripts/print_handlers_md.py,.copr/*,.env
[testenv:docs]
description = invoke sphinx-build to build the HTML docs
basepython = python3
deps =
-r{toxinidir}/test-requirements.txt
Sphinx>=4.2
sphinx_rtd_theme
sphinxcontrib-httpdomain
sphinx_rtd_theme
commands =
python3 -m 'sphinx' {toxinidir}/docs "{toxinidir}/docs/_build/html" -W {posargs}
[pytest]
addopts = --cov=freshmaker
testpaths = tests
[coverage:report]
skip_covered = 1
show_missing = 1
fail_under = 80
omit =
.tox
.env
tests/*
/usr/*