forked from pharmpy/pharmpy
-
Notifications
You must be signed in to change notification settings - Fork 0
/
tox.ini
171 lines (156 loc) · 3.83 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
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
; a generative tox configuration, see: https://tox.readthedocs.io/en/latest/config.html#generative-envlist
;
[tox]
skip_missing_interpreters=True
envlist =
{py38-,py39-,py310-,}{doctest,unit,integration}{-cover,}
{py38-,py39-,py310-,}{lint,format,report,docs-build,docs-test,docs-lint},
clean,
spell,
licenses,
run
[testenv]
skip_install = true
setenv =
PYTHONPATH={toxinidir}/tests
PYTHONUNBUFFERED=yes
PYTHONASYNCIODEBUG=1
PHARMPYNOCONFIGFILE=1
passenv =
*
usedevelop = false
allowlist_externals =
bash
rm
printf
false
commands =
printf "ERROR: unknown environment '%s'\n" {envname}
printf "Maybe factors where given in the wrong order?\n"
false
[base]
deps =
pytest>5.3.5
pytest-asyncio>=0.17.0
pytest-xdist>1.34.0,<3.0.2
cover: pytest-cov
profile: pytest-profiling
profile: gprof2dot==2019.11.30
debug: pdbpp
[flags]
cover = --cov --cov-report=term-missing --cov-report=term:skip-covered --cov-report xml:.coverage.xml
profile = --profile-svg
debug = --pdb
[testenv:{py38,py39,py310,py38-unit,py39-unit,py310-unit,unit}{-cover,}{-profile,}{-debug,}]
skip_install = false
deps =
-rrequirements.txt
{[base]deps}
commands = pytest -n auto -vv \
profile: {[flags]profile} \
cover: {[flags]cover} \
debug: {[flags]debug} \
{posargs:tests}
[testenv:{py38-,py39-,py310-,}doctest{-cover,}]
skip_install = false
deps =
-rrequirements.txt
{[base]deps}
commands = pytest -W ignore::UserWarning -n auto -vv \
profile: {[flags]profile} \
cover: {[flags]cover} \
debug: {[flags]debug} \
--doctest-modules {posargs:src}
[testenv:{py38-,py39-,py310-,}integration{-cover,}{-profile,}{-debug,}]
skip_install = false
deps =
-rrequirements.txt
{[base]deps}
setenv =
PHARMPYNOCONFIGFILE=0
commands = pytest -vv \
profile: {[flags]profile} \
cover: {[flags]cover} \
debug: {[flags]debug} \
{posargs:tests/integration}
[testenv:{py38-,py39-,py310-,}run]
setenv =
PHARMPYNOCONFIGFILE=0
skip_install = false
deps =
-rrequirements.txt
commands = {posargs}
[testenv:spell]
basepython = {env:TOXPYTHON:python2.7}
setenv =
SPELLCHECK=1
commands =
sphinx-build -j auto -b spelling docs dist/docs
deps =
-r{toxinidir}/docs/requirements.txt
sphinxcontrib-spelling
pyenchant
[testenv:{py38-,py39-,py310-,}docs-{build,test}]
skip_install = false
deps =
-rrequirements.txt
-r{toxinidir}/docs/requirements.txt
commands =
pip install ipykernel==5.5.5 # Unable to build docs with newer version
pip install sphinx>=5.1.1
pip install sphinx-tabs>=3.4.1
build: rm -rf docs/api
build: sphinx-build {posargs:-E} -j auto -b html docs dist/docs
build: sphinx-build -j auto -b linkcheck docs dist/docs
test: sphinx-build {posargs:-E} -j auto -b doctest docs dist/docs
[testenv:{py38-,py39-,py310-,}{lint,format}]
deps =
docutils
check-manifest >= 0.45
flake8
readme-renderer
pygments
isort >= 5.0.0
twine
black
flake8-black
commands =
check-manifest \
format: -u \
-v {toxinidir}
black \
lint: --check --diff \
src tests setup.py
flake8 src tests setup.py
isort \
lint: --check --diff \
src tests setup.py
bash scripts/lint_deps_imports.sh
[testenv:{py38-,py39-,py310-,}{type-check}]
deps =
-rrequirements.txt
pytest>5.3.5
pyright
commands =
pyright {posargs:src/pharmpy}
[testenv:{py38-,py39-,py310-,}report]
deps = coverage
commands =
coverage report
coverage html
[testenv:clean]
commands = coverage erase
deps = coverage
[testenv:licenses]
skip_install = false
deps =
-rrequirements.txt
pip-licenses
commands =
pip-licenses
[testenv:{py38-,py39-,py310-,}docs-lint]
skip_install = false
deps =
darglint
commands =
darglint --docstring-style numpy -z long src/pharmpy/modeling