-
Notifications
You must be signed in to change notification settings - Fork 4
/
tox.ini
162 lines (146 loc) · 3.89 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
[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,B028
# 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
[tox]
requires = tox-conda
isolated_build = True
envlist =
covclean
lint
py{3.8,3.9,3.10,3.11,3.12}-{slepc,noslepc}
coverage
readme
check-docs
docs
skip_missing_interpreters=true
[testenv]
deps =
pytest
pytest-cov
pytest-mock
conda_deps =
slepc: mpi4py
slepc: petsc4py
slepc: slepc4py
conda_channels=
conda-forge
passenv = TOXENV,CI,CODECOV_*,GITHUB_ACTIONS
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{3.8,3.9,3.10,3.11,3.12}
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.
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.
deps = sphinx
skip_install = true
changedir = {toxinidir}/docs
allowlist_externals = make
commands = make clean
[testenv:check-docs]
description = Check the links in the docs.
deps = -r{toxinidir}/docs/requirements.txt
skip_install = true
allowlist_externals = sphinx-build
passenv = PYENCHANT_LIBRARY_PATH
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.
skip_install = true
deps = -r{toxinidir}/docs/requirements.txt
allowlist_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.
deps = twine >= 1.12.1
skip_install = true
commands =
pip wheel -q -w {envtmpdir}/build --no-deps .
twine check {envtmpdir}/build/*