-
Notifications
You must be signed in to change notification settings - Fork 57
/
tox.ini
84 lines (76 loc) · 5.98 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
# tox (https://tox.readthedocs.io/) is a tool for running tests and other continuous
# integration tools 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.
[tox]
envlist = py3, docs, benchmarks, black, isort, pylint
[testenv]
usedevelop = True
extras = full
deps = -r{toxinidir}/tests/requirements.txt
commands =
pytest {posargs:--cov=probnum --no-cov-on-fail --cov-report=xml} --doctest-modules --color=yes
[testenv:docs]
description = Invoke sphinx-build to build the HTML docs
basepython = python3
passenv = HOME
deps = -r{toxinidir}/docs/requirements.txt
changedir = docs
allowlist_externals = make
commands =
make clean
make html
[testenv:format]
description = Code formatting with Black and isort (and possibly other tools in the future)
basepython = python3
deps = -r{toxinidir}/formatting-requirements.txt
commands =
black .
isort --profile black .
[testenv:black]
description = Check code formatting with Black
envdir = {toxworkdir}/format
basepython = {[testenv:format]basepython}
deps = {[testenv:format]deps}
commands = black --check --diff .
[testenv:isort]
description = Check import sorting with isort
envdir = {toxworkdir}/format
basepython = {[testenv:format]basepython}
deps = {[testenv:format]deps}
commands = isort --profile black --check --diff .
[testenv:benchmarks]
description = Dry run the benchmarks to check for errors
basepython = python3
deps = -r{toxinidir}/benchmarks/requirements.txt
changedir = benchmarks
commands =
asv check --environment existing
asv machine --yes
asv run -e --quick --dry-run --strict --show-stderr --python=same
[testenv:pylint]
basepython = python3
description = Code linting with pylint
deps =
-r{toxinidir}/tests/requirements.txt
-r{toxinidir}/linting-requirements.txt
ignore_errors = true
commands =
# Global Linting Pass
pylint src/probnum \
--ignore-paths=src/probnum/_pnmethod,src/probnum/diffeq/,src/probnum/filtsmooth/,src/probnum/linalg/,src/probnum/problems/,src/probnum/quad/,src/probnum/randprocs/markov/,src/probnum/randvars/ \
--jobs=0
# Per-package Linting Passes
pylint src/probnum/_pnmethod --disable="missing-param-doc,too-few-public-methods" --jobs=0
pylint src/probnum/diffeq --disable="redefined-outer-name,too-many-instance-attributes,too-many-arguments,too-many-locals,too-few-public-methods,protected-access,unnecessary-pass,unused-variable,unused-argument,used-before-assignment,no-self-use,duplicate-code,missing-function-docstring,missing-param-doc,missing-type-doc,missing-raises-doc,missing-return-type-doc,missing-yield-type-doc,missing-any-param-doc" --jobs=0
pylint src/probnum/filtsmooth --disable="no-member,arguments-differ,too-many-arguments,too-many-locals,too-few-public-methods,protected-access,unused-variable,unused-argument,no-self-use,duplicate-code,useless-param-doc,missing-return-type-doc,missing-param-doc,missing-type-doc,missing-raises-doc,missing-yield-type-doc" --jobs=0
pylint src/probnum/linalg --disable="no-member,abstract-method,arguments-differ,else-if-used,redefined-builtin,too-many-instance-attributes,too-many-arguments,too-many-locals,too-many-lines,too-many-statements,too-many-branches,too-complex,too-few-public-methods,protected-access,unused-argument,attribute-defined-outside-init,no-else-return,no-else-raise,no-self-use,duplicate-code,missing-module-docstring,missing-param-doc,missing-type-doc,missing-raises-doc,missing-return-type-doc,consider-using-f-string,missing-any-param-doc" --jobs=0
pylint src/probnum/problems --disable="too-many-arguments,too-many-locals,unused-variable,unused-argument,consider-using-from-import,duplicate-code,missing-module-docstring,missing-function-docstring,missing-param-doc,missing-type-doc,missing-raises-doc,missing-return-type-doc,missing-timeout,use-dict-literal,missing-any-param-doc" --jobs=0
pylint src/probnum/quad --disable="too-many-arguments,missing-module-docstring,use-dict-literal" --jobs=0
pylint src/probnum/randprocs/markov --disable="arguments-differ,arguments-renamed,too-many-instance-attributes,too-many-arguments,too-many-locals,protected-access,unused-argument,no-else-return,duplicate-code,missing-module-docstring,missing-class-docstring,missing-function-docstring,missing-type-doc,missing-raises-doc,useless-param-doc,useless-type-doc,missing-return-type-doc,missing-param-doc,missing-any-param-doc,method-cache-max-size-none" --jobs=0
pylint src/probnum/randvars --disable="too-many-arguments,too-many-locals,too-many-branches,too-few-public-methods,protected-access,unused-argument,duplicate-code,missing-function-docstring,missing-raises-doc,missing-return-type-doc,missing-param-doc,broad-exception-raised" --jobs=0
# Benchmark and Test Code Linting Pass
# pylint benchmarks --disable="unused-argument,attribute-defined-outside-init,missing-function-docstring" --jobs=0 # not a work in progress, but final
pylint benchmarks --disable="unused-argument,attribute-defined-outside-init,no-else-return,no-self-use,consider-using-from-import,missing-module-docstring,missing-class-docstring,missing-function-docstring,missing-return-type-doc,missing-any-param-doc,missing-raises-doc,missing-param-doc,missing-type-doc" --jobs=0
# pylint tests --disable="missing-function-docstring" --jobs=0 # not a work in progress, but final
pylint tests --disable="arguments-differ,redefined-outer-name,too-many-instance-attributes,too-many-arguments,too-many-locals,too-few-public-methods,protected-access,unnecessary-pass,unused-variable,unused-argument,unused-private-member,attribute-defined-outside-init,no-else-return,no-self-use,consider-using-from-import,duplicate-code,missing-module-docstring,missing-class-docstring,missing-function-docstring,missing-param-doc,missing-type-doc,missing-raises-doc,missing-return-type-doc,redundant-returns-doc,missing-any-param-doc,unexpected-keyword-arg,no-member,use-dict-literal,import-error,superfluous-parens,used-before-assignment" --jobs=0