-
Notifications
You must be signed in to change notification settings - Fork 1
/
tox.ini
77 lines (69 loc) · 1.77 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
[base]
# set the python package name for use in other sections
name = argortqcpy
[tox]
# 3.1.0 required for ignore_basepython_conflict
minversion = 3.1.0
# always use the python version specified in the environment name
ignore_basepython_conflict = true
# set which envs are run when tox is used with no args (e.g. from PyCharm)
envlist = py36, build, docs, lint
[testenv]
extras = test
commands =
# tox tests against the installed package, so we can't use the source path
pytest \
--cov {envsitepackagesdir}/{[base]name} \
--cov-branch \
--cov-report=term-missing \
--cov-report=xml \
-s \
-v \
{posargs:tests}
[testenv:lint]
deps =
pylint
pycodestyle
pydocstyle
black
mypy
commands =
black --line-length 120 --check --diff setup.py
black --line-length 120 --check --diff docs/source/conf.py
black --line-length 120 --check --diff {[base]name}
pylint {[base]name}
pycodestyle {[base]name}
pydocstyle {[base]name}
mypy {[base]name}
black --line-length 120 --check --diff tests
pylint tests
pycodestyle tests
pydocstyle tests
mypy --allow-untyped-defs tests
[testenv:build]
skip_install = true
skipsdist = true
deps =
wheel
twine
commands =
python setup.py clean --all --build-temp dist/
python setup.py sdist bdist_wheel
twine check dist/*
[testenv:docs]
extras = docs
changedir = docs
commands =
# -W option fails on warning
sphinx-build -M clean source build -W
sphinx-build -M html source build -W
[testenv:format]
skip_install = true
skipsdist = true
deps =
black
commands =
black --line-length 120 setup.py
black --line-length 120 docs/source/conf.py
black --line-length 120 {[base]name}
black --line-length 120 tests