-
Notifications
You must be signed in to change notification settings - Fork 7
/
tox.ini
50 lines (45 loc) · 1.78 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
[tox]
envlist = check,_auto_version
[testenv]
changedir = {envtmpdir}
extras =
dev
setenv =
_PYTHON_SOURCE_PATHS = {toxinidir}/bin/pylddwrap {toxinidir}/lddwrap/ {toxinidir}/precommit.py {toxinidir}/setup.py
_PYTHON_TEST_PATHS = {toxinidir}/tests/
_PYTHON_PATHS = {env:_PYTHON_SOURCE_PATHS} {env:_PYTHON_TEST_PATHS}
_YAPF_OPTIONS = --style={toxinidir}/style.yapf --recursive {env:_PYTHON_PATHS}
_ISORT_OPTIONS = --settings-path={toxinidir}/.isort.cfg --recursive {env:_PYTHON_PATHS}
COVERAGE_FILE={toxinidir}/.coverage
commands =
coverage run --source lddwrap -m unittest discover --top-level-directory {toxinidir} {toxinidir}/tests
coverage xml -o {toxinidir}/coverage.xml
coverage report
[testenv:pex]
deps =
pex==1.5.1
commands =
pex -r {toxinidir}/requirements.txt -v -e lddwrap.main:main -o {toxworkdir}/{envname}/pylddwrap.pex
[testenv:format]
commands =
yapf --in-place {env:_YAPF_OPTIONS}
isort {env:_ISORT_OPTIONS}
[testenv:check]
allowlist_externals =
find
commands =
yapf --diff {env:_YAPF_OPTIONS}
mypy --config-file {toxinidir}/mypy.ini {env:_PYTHON_PATHS}
isort --check-only {env:_ISORT_OPTIONS}
pylint --rcfile={toxinidir}/pylint.rc {env:_PYTHON_PATHS}
pydocstyle {env:_PYTHON_SOURCE_PATHS}
find {toxinidir} -regextype posix-egrep -regex '{toxinidir}/(lddwrap/.*\.py|README.rst)' -exec {envpython} -m doctest \{\} ;
pyicontract-lint {toxinidir}/lddwrap/
python {toxinidir}/setup.py check --restructuredtext --strict
[testenv:check-coverage]
changedir = {toxinidir}
commands =
coverage combine coverage_reports/
coverage xml -o {toxinidir}/coverage.xml
coverage report --fail-under=90 --ignore-errors --show-missing
diff-cover --fail-under=100 {posargs:--compare-branch=master} coverage.xml