-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtox.ini
43 lines (40 loc) · 1.74 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
[tox]
minversion = 2.5.0
envlist = py{37,38,39,310,311}-{flake8,unit,bandit,mypy,prospector,sphinx}
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
envlist = py{37,39,311}-{flake8,unit},py39-{bandit,mypy,prospector,sphinx}
[testenv]
usedevelop = True
description =
flake8: Style consistency checker
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
py37: (Python 3.7)
py38: (Python 3.8)
py39: (Python 3.9)
py310: (Python 3.10)
py311: (Python 3.11)
commands =
flake8: flake8 setup.py wmflib
unit: py.test --strict-markers --cov-report=term-missing --cov=wmflib wmflib/tests/unit {posargs}
# Skip some bandit issues:
# - assert_used (B101) in tests
# - blacklist of 'input' (B322, for Py2 only) and 'subprocess' (B404) modules
# - 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 './wmflib/tests' ./wmflib/
bandit: bandit -l -i -r --skip B101,B113,B404 wmflib/tests
mypy: mypy wmflib/
prospector: prospector --no-external-config --profile '{toxinidir}/prospector.yaml' {posargs} {toxinidir}
sphinx: python wmflib/tests/sphinx_checker.py '{toxinidir}'
sphinx: sphinx-build -W -b html '{toxinidir}/doc/source/' '{toxinidir}/doc/build/html'
deps =
# Use install_requires and the additional extras_require[tests/prospector] from setup.py
prospector: .[prospector]
!prospector: .[tests]