forked from pybamm-team/PyBaMM
-
Notifications
You must be signed in to change notification settings - Fork 0
/
tox.ini
127 lines (112 loc) · 3.17 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
[tox]
envlist = {windows}-{tests,quick,dev},tests,quick,dev
[testenv]
skipsdist = true
skip_install = flake8: true
usedevelop = true
passenv = !windows-!mac: SUNDIALS_INST
whitelist_externals = !windows-!mac: sh
setenv =
!windows-!mac: SUNDIALS_INST = {env:SUNDIALS_INST:{homedir}/.local}
!windows-!mac: LD_LIBRARY_PATH = {homedir}/.local/lib{:}{env:LD_LIBRARY_PATH:}
deps =
dev-!windows-!mac: cmake
dev: black
dev: flake8
dev,doctests: sphinx>=1.5
dev,doctests: guzzle-sphinx-theme
!windows-!mac: scikits.odes
commands =
tests-!windows-!mac: sh -c "pybamm_install_jax" # install jax, jaxlib for ubuntu
tests: python run-tests.py --unit --folder all
quick: python run-tests.py --unit
integration: python run-tests.py --unit --folder integration
examples: python run-tests.py --examples
dev-!windows-!mac: sh -c "echo export LD_LIBRARY_PATH={env:LD_LIBRARY_PATH} >> {envbindir}/activate"
doctests: python run-tests.py --doctest
[testenv:pybamm-requires]
platform = [linux,darwin]
skip_install = true
passenv = HOME
whitelist_externals = git
deps =
wget
cmake
commands =
python {toxinidir}/scripts/install_KLU_Sundials.py
- git clone https://github.com/pybind/pybind11.git {toxinidir}/pybind11
[testenv:flake8]
skip_install = true
deps = flake8>=3
commands = python -m flake8
[testenv:coverage]
deps =
coverage
scikits.odes
commands =
!windows-!mac: sh -c "pybamm_install_jax"
coverage run run-tests.py --nosub
# Some tests make use of multiple processes through
# multiprocessing. Coverage data is then generated for each
# process separately and data must then be combined into one
# single coverage data file.
coverage combine
coverage xml
[testenv:docs]
skipdist = false
usedevelop = false
skip_install = false
deps =
sphinx>=1.5
guzzle-sphinx-theme
sphinx-autobuild
changedir = docs
commands = sphinx-autobuild --open-browser -qT . {envtmpdir}/html
[flake8]
max-line-length = 88
exclude=
.git,
problems,
__init__.py,
venv,
bin,
etc,
lib,
lib64,
share,
pyvenv.cfg,
third-party,
sundials-5.0.0,
KLU_module_deps,
pybind11,
install_KLU_Sundials,
ignore=
# False positive for white space before ':' on list slice
# black should format these correctly
E203,
# Block comment should start with '# '
# Not if it's a commented out line
E265,
# Ambiguous variable names
# It's absolutely fine to have i and I
E741,
# List comprehension redefines variable
# Re-using throw-away variables like `i`, `x`, etc. is a Good Idea
F812,
# Blank line at end of file
# This increases readability
W391,
# Line break before binary operator
# This is now actually advised in pep8
W503,
# Line break after binary operator
W504,
# Invalid escape sequence
# These happen all the time in latex parts of docstrings,
# e.g. \sigma
W605,
[coverage:run]
source = pybamm
# By default coverage data isn't collected in forked processes, see
# https://coverage.readthedocs.io/en/coverage-5.3.1/subprocess.html
concurrency = multiprocessing