-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtox.ini
61 lines (57 loc) · 2.57 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
[tox]
minversion = 3.10.0
envlist = py{39,310,311}-{flake8,unit,bandit,mypy,prospector,sphinx},py{39,310,311}-style
skip_missing_interpreters = True
[tox:jenkins]
# If CI is missing a python version we require, it should fail!
# More info on the rationale: https://phabricator.wikimedia.org/T372485
skip_missing_interpreters = false
# Only run lint check and unit tests on different python versions
# CI docker-registry.wikimedia.org/releng/tox-v3 defaults to 3.7, we want 3.9 at least.
envlist = py{39,310,311}-{flake8,unit},py39-{style,bandit,mypy,prospector,sphinx}
[testenv]
usedevelop = True
download = True
allowlist_externals =
sed
{toxinidir}/utils/check-style.sh
{toxinidir}/utils/format-code.sh
description =
flake8: Style consistency checker
style: Style consistency checker
format: Autoformat the changed files to match the style
unit: Run unit tests
bandit: Security-oriented static analyzer
mypy: Static analyzer for type annotations
prospector: Static analysis multi-tool
sphinx: Build documentation and manpages
py3: (Python 3)
py39: (Python 3.9)
py310: (Python 3.10)
py311: (Python 3.11)
commands =
flake8: flake8 setup.py spicerack
style: {toxinidir}/utils/check-style.sh
format: {toxinidir}/utils/format-code.sh
unit: py.test --strict-markers --cov-report=term-missing --cov=spicerack spicerack/tests/unit {posargs}
# Skip some bandit issues:
# - assert_used (B101) in tests
# - blacklist of 'subprocess' module (B404)
# - use of subprocess_without_shell_equals_true (B603) to alert if shell True is used instead
bandit: bandit -l -i -r --skip B404,B603 --exclude './spicerack/tests' ./spicerack/
bandit: bandit -l -i -r --skip B101,B105,B106,B113,B404 spicerack/tests
mypy: mypy --show-error-codes spicerack/
prospector: prospector --profile '{toxinidir}/prospector.yaml' {posargs} {toxinidir}
sphinx: python spicerack/tests/sphinx_checker.py '{toxinidir}'
sphinx: sphinx-build -W -b html '{toxinidir}/doc/source/' '{toxinidir}/doc/build/html'
sphinx: sphinx-build -W -b man '{toxinidir}/doc/source/' '{toxinidir}/doc/build/man'
# Fix missing space after bold blocks in man page: https://github.com/ribozz/sphinx-argparse/issues/80
sphinx: sed -i='' -e 's/^\.B/.B /' '{toxinidir}/doc/build/man/cookbook.1'
deps =
# Use install_requires and the additional extras_require[tests/prospector] from setup.py
flake8: .[flake8]
style: .[format]
format: .[format]
prospector: .[prospector]
!flake8-!prospector-!style-!format: .[tests]
[testenv:py3-{format,style}]