forked from ICB-DCM/pyABC
-
Notifications
You must be signed in to change notification settings - Fork 0
/
tox.ini
173 lines (154 loc) · 3.85 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
172
173
# tox (https://tox.readthedocs.io/) is a tool for running tests
# in multiple virtualenvs. This configuration file will run the
# test suite on all supported python versions. To use it, "pip install tox"
# and then run "tox" from this directory.
# See https://tox.readthedocs.io/en/latest/config.html for reference.
[tox]
# Environments run by default and in this order
# unless specified via CLI -eENVLIST
# or environment variable TOXENV
envlist =
clean
# tests
base
visualization
external
petab
mac
# quality
project
flake8
doc
# Base-environment
[testenv]
# Sub-environments
# inherit settings defined in the base
[testenv:clean]
skip_install = true
allowlist_externals =
rm
deps = coverage
commands =
coverage erase
rm -rf .coverage*
rm -rf coverage.xml
rm -rf dask-worker-space
description =
Clean up before tests
# Unit tests
[testenv:base]
extras = test,R,pyarrow,autograd
passenv = HOME
commands =
# needed by pot
pip install cython
pip install pot
pytest --cov=pyabc --cov-report=xml --cov-append \
test/base test_performance -s
description =
Test basic functionality
[testenv:visualization]
extras = test,plotly,webserver_dash,webserver_flask
commands =
pytest --cov=pyabc --cov-report=xml --cov-append \
test/visualization
description =
Test visualization
[testenv:external]
extras = test,R,julia,copasi
commands =
# General
pytest --cov=pyabc --cov-report=xml --cov-append \
test/external/test_external.py -s
# R
pytest --cov=pyabc --cov-report=xml --cov-append \
test/external/test_rpy2.py -s
# Julia
python -c "import julia; julia.install()"
python -m pytest --cov=pyabc --cov-report=xml --cov-append \
test/external/test_pyjulia.py -s
# Copasi
pytest --cov=pyabc --cov-report=xml --cov-append \
test/copasi -s
description =
Test external model simulators
[testenv:petab]
extras = test,petab,amici,test_petab
commands =
pytest --cov=pyabc --cov-report=xml --cov-append \
test/petab -s
description =
Test PEtab support
[testenv:mac]
extras = test
commands =
pytest --cov=pyabc --cov-report=xml --cov-append \
test/base/test_macos.py -s
description =
Test basic macOS support (run there)
[testenv:migrate]
extras = test,migrate
deps = pytest-console-scripts
commands =
# install an old pyabc version
pip install pyabc==0.10.13 pandas==1.5.0 sqlalchemy==1.4.48
python test/migrate/create_test_db.py
# back to latest pyabc version
pip install --upgrade .
pytest --cov=pyabc --cov-report=xml --cov-append \
test/migrate -s
description =
Test database migration
[testenv:notebooks1]
allowlist_externals = bash
extras = examples
commands =
# needed by pot
pip install cython
pip install pot
bash test/run_notebooks.sh 1
description =
Run notebooks
[testenv:notebooks2]
allowlist_externals = bash
extras = examples,R,petab,yaml2sbml,amici,autograd
commands =
bash test/run_notebooks.sh 2
description =
Run notebooks
# Style, management, docs
[testenv:project]
skip_install = true
deps =
pyroma
restructuredtext-lint
commands =
pyroma --min=10 .
rst-lint README.rst
description =
Check the package friendliness
[testenv:flake8]
skip_install = true
deps =
black >= 22.3.0
flake8 >= 3.8.3
flake8-bandit >= 4.1.1
flake8-bugbear >= 22.8.23
flake8-colors >= 0.1.6
#flake8-commas >= 2.0.0
flake8-comprehensions >= 3.2.3
flake8-print >= 5.0.0
flake8-black >= 0.2.3
flake8-isort >= 4.0.0
# flake8-docstrings >= 1.5.0
commands =
flake8 pyabc test test_performance setup.py
description =
Run flake8 with various plugins
[testenv:doc]
extras =
doc,petab,plotly
commands =
sphinx-build -W -b html doc/ doc/_build/html
description =
Test whether docs build passes