forked from msmdev/pyGPCCA
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtox.ini
183 lines (165 loc) · 4.37 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
174
175
176
177
178
179
180
181
182
183
[flake8]
per-file-ignores =
*/__init__.py: D104, F401
tests/*: D
docs/source/*: D
pygpcca/utils/_checks.py: B902
# D104 Missing docstring in public package
# D104 Missing docstring in magic method
# F401 ... imported but unused
# B902 blind except Exception: statement
ignore = D100,D105,D107,RST201,RST203,RST301,RST306,E203
# D100 D100 Missing docstring in public module
# D107 Missing docstring in __init__
# RST201 Block quote ends without a blank line; unexpected unindent.
# RST203 Definition list ends without a blank line; unexpected unindent. - happens because of docrep
# RST301 Unexpected indentation. - happens because of docrep
# RST306 Unknown target name: ...
# E203 whitespace before ':'
exclude =
.git
build
dist
__pycache__
setup.py
max_line_length = 120
filename = *.py
ban-relative-imports = true
enable-extensions=G
rst-roles =
mod
class
meth
func
attr
paramref
ref
rst-directives =
envvar
exception
[doc8]
max-line-length = 120
ignore-path = .tox,docs/source/api,pygpcca.egg-info,dist,build
quiet = 1
[pytest]
python_files = test_*.py
testpaths = tests/
xfail_strict = true
[coverage:run]
branch = true
parallel = true
source = pygpcca
omit = */__init__.py
[coverage:paths]
source =
pygpcca
*/site-packages/pygpcca
[coverage:report]
exclude_lines =
\#.*pragma:\s*no.?cover
^if __name__ == .__main__.:$
^\s*raise AssertionError\b
^\s*raise NotImplementedError\b
^\s*return NotImplemented\b
show_missing = true
precision = 2
skip_empty = True
sort = Miss
[gh-actions]
python =
3.7: py37
3.8: py38
3.9: py39
[gh-actions:env]
PLATFORM =
ubuntu-latest: linux
macos-latest: macos
# tox-gh-actions does not support negation (!)
USE_SLEPC =
true: slepc
false: noslepc
[tox]
isolated_build = True
envlist =
covclean
lint
py{37,38,39}-{linux,macos}-{slepc,noslepc}
coverage
readme
check-docs
docs
skip_missing_interpreters=true
[testenv]
platform =
linux: linux
macos: (osx|darwin)
deps =
pytest
pytest-cov
pytest-mock
# we manually install PETSc and SLEPc on the CI from source and the [dev] installation causes problems
slepc: mpi4py>=3.0.3
slepc: petsc==3.15.4
slepc: petsc4py==3.15.1
slepc: slepc==3.15.2
slepc: slepc4py==3.15.1
passenv = TOXENV CI CODECOV_* GITHUB_ACTIONS PETSC_* SLEPC_*
usedevelop = true
commands = python -m pytest --cov --cov-append --cov-report=term-missing --cov-config={toxinidir}/tox.ini --ignore docs/ {posargs:-vv}
[testenv:covclean]
description = Clean coverage files.
deps = coverage
skip_install = True
commands = coverage erase
[testenv:coverage]
description = Report the coverage difference.
deps =
coverage
diff_cover
skip_install = true
depends = py{37,38,39}-{linux,macos}
parallel_show_output = True
commands =
coverage report --omit="tox/*"
coverage xml --omit="tox/*" -o {toxinidir}/coverage.xml
diff-cover --compare-branch origin/main {toxinidir}/coverage.xml
[testenv:lint]
description = Perform linting.
basepython = python3.8
deps = pre-commit>=2.7.1
skip_install = true
commands = pre-commit run --all-files --show-diff-on-failure {posargs:}
[testenv:clean-docs]
description = Clean the documentation artifacts.
basepython = python3.8
deps =
skip_install = true
changedir = {toxinidir}/docs
whitelist_externals = make
commands = make clean
[testenv:check-docs]
description = Check the links in the docs.
basepython = python3.8
deps = -r{toxinidir}/docs/requirements.txt
skip_install = true
whitelist_externals = sphinx-build
commands =
sphinx-build -b spelling {toxinidir}/docs/source {toxinidir}/docs/build/spellcheck
sphinx-build -q -W --keep-going -b linkcheck {toxinidir}/docs/source {toxinidir}/docs/build/linkcheck
[testenv:docs]
description = Build the documentation.
basepython = python3.8
skip_install = true
deps = -r{toxinidir}/docs/requirements.txt
whitelist_externals = sphinx-build
commands =
sphinx-build --color -b html {toxinidir}/docs/source {toxinidir}/docs/build/html
python -c 'import pathlib; print(f"Documentation is available under:", pathlib.Path(f"{toxinidir}") / "docs" / "build" / "html" / "index.html")'
[testenv:readme]
description = Check if README renders on PyPI.
basepython = python3.8
deps = twine >= 1.12.1
skip_install = true
commands =
pip wheel -q -w {envtmpdir}/build --no-deps .
twine check {envtmpdir}/build/*