-
Notifications
You must be signed in to change notification settings - Fork 16
/
tox.ini
121 lines (112 loc) · 5.16 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
[tox]
; default testenv(s) to run on raw `tox` calls.
envlist = py312-test
[testenv]
extras =
dev
complete
# Run test suite ==============================================================
[testenv:py{310,311,312}-test]
description =
Run Pyxu test suite.
Executing this testenv without any extra parameters consists in running a
subset of the test suite which runs in ~5[min]. Pass the `all` parameter
to execute the complete test suite. (Takes ~1[day].)
usedevelop = true
allowlist_externals =
/bin/sh
commands =
/bin/sh -c ' \
if [ -z "{posargs}" ]; then \
python3 -m pytest \
--verbosity=1 \
-r a \
-k="not (pinv or dagger or asarray)" \
{toxinidir}/src/pyxu_tests/math/ \
{toxinidir}/src/pyxu_tests/operator/interop/test_sciop.py \
{toxinidir}/src/pyxu_tests/operator/interop/test_source.py \
{toxinidir}/src/pyxu_tests/operator/examples/ \
{toxinidir}/src/pyxu_tests/opt/solver/test_cg.py \
{toxinidir}/src/pyxu_tests/util/; \
elif [ "{posargs}" = "all" ]; then \
python3 -m pytest \
--verbosity=1 \
-r a \
{toxinidir}/src/pyxu_tests/; \
else \
exit 1; \
fi \
'
# Pre-commit hooks ============================================================
[testenv:pre-commit]
description =
Run all pre-commit hooks.
This is a helper function to ease friction during git commits.
skip_install = true
allowlist_externals =
pre-commit
commands =
pre-commit run --all-files
# Generate documentation ======================================================
[testenv:doc]
description =
Build Pyxu HTML documentation.
Executing this testenv without any extra parameters performs an incremental
build. Pass the `clean` parameter to re-build the entire HTML docs from
scratch.
skip_install = true
allowlist_externals =
/bin/sh
commands =
/bin/sh -c ' \
if [ -z "{posargs}" ]; then \
sphinx-build -b html \
-j auto \
-w {toxinidir}/build/html/WARNINGS.log \
{toxinidir}/doc/ \
{toxinidir}/build/html/; \
elif [ "{posargs}" = "clean" ]; then \
rm -rf {toxinidir}/build/html/; \
sphinx-build -b html \
-a \
-E \
-j auto \
-w {toxinidir}/build/html/WARNINGS.log \
{toxinidir}/doc/ \
{toxinidir}/build/html/; \
else \
exit 1; \
fi \
'
# Build PyPI wheels ===========================================================
[testenv:dist]
description =
Build universal wheels for PyPI.
Packages are placed under ./dist/.
skip_install = true
allowlist_externals =
hatch
commands =
hatch build -t wheel
# Flake8 Configuration ========================================================
[flake8]
max-complexity = 10
exclude =
# __init__.py often contain weird code to import top-level items.
__init__.py
extend-ignore =
# We follow Black's guidelines here.
# E501: line too long
# E203: whitespace before ':'
# E302: expected 2 blank lines, found 1
E501
E203
E302
# Do not use lambda expressions. (OK when used sparringly.)
E731
# Too many leading '#' for block comment.
# We use more '#' terms at times to improve visual delimiters of long block comments.
E266
# Implementation is too complex.
# (Sometimes necessary in scientific code.)
C901