forked from scverse/squidpy
-
Notifications
You must be signed in to change notification settings - Fork 0
/
tox.ini
227 lines (204 loc) · 5.81 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
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
[flake8]
per-file-ignores =
*/__init__.py: D104, F401
tests/*: D
docs/*: D,B
squidpy/pl/_ligrec.py: D,B
squidpy/_constants/_pkg_constants.py: D101,D102,D106
squidpy/_constants/_constants.py: D101
squidpy/pl/_interactive/_widgets.py: D
.scripts/ci/download_data.py: D,B
squidpy/*.py: RST303
# D104 Missing docstring in public package
# F401 ... imported but unused
# RST303 Unknown directive type
# D100 D100 Missing docstring in public module
# D107 Missing docstring in __init__
# B008 Do not perform function calls in argument defaults.
# W503 line break before binary operator
# D105 Missing docstring in magic method
# E203 whitespace before ':'
# P101 format string does contain unindexed parameters
# docrep interferences:
# RST201 Block quote ends without a blank line; unexpected unindent.
# RST301 Unexpected indentation.
# RST306 Unknown target name:
# RST203 Definition list ends without a blank line; unexpected unindent.
ignore = D100,D107,B008,W503,D105,E203,P101,RST201,RST301,RST306,RST203,B024
exclude =
.git
.tox
build
dist
__pycache__
setup.py
max_line_length = 120
filename = *.py
ban-relative-imports = true
rst-roles =
mod
class
meth
func
attr
paramref
ref
cite
rst-directives =
envvar
exception
[doc8]
max-line-length = 120
ignore-path = .tox,docs/source/api,squidpy.egg-info,dist,build
quiet = 1
[pytest]
python_files = test_*.py
testpaths = tests/
xfail_strict = true
qt_api=pyqt5
; addopts = -n auto
filterwarnings =
ignore::UserWarning
ignore:Using or importing the ABCs from 'collections':DeprecationWarning
ignore:Converting `np.inexact`:DeprecationWarning
ignore:the matrix subclass is:PendingDeprecationWarning
ignore:Please use:DeprecationWarning:dask_image.*
ignore:Auto-removal of grids by:DeprecationWarning:
ignore:Support for passing numbers through unit converters:DeprecationWarning
ignore:distutils Version classes are deprecated:DeprecationWarning
ignore::anndata.OldFormatWarning
[coverage:run]
branch = true
parallel = true
source = squidpy
omit =
*/__init__.py
*/_version.py
squidpy/pl/_interactive/*
[coverage:paths]
source =
squidpy
*/site-packages/squidpy
[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.8: py38
3.9: py39
3.10: py310
[gh-actions:env]
PLATFORM =
ubuntu-latest: linux
macos-latest: macos
[tox]
isolated_build = True
envlist =
covclean
lint
py{3.8,3.9,3.10}-{linux,macos}
coverage
readme
check-docs
docs
skip_missing_interpreters = true
[testenv]
platform =
linux: linux
macos: (osx|darwin)
deps =
pytest
pytest-xdist
pytest-cov
pytest-qt
pytest-mock
pytest-timeout
# see: https://github.com/numba/llvmlite/issues/669
extras = interactive
setenv = linux: PYTEST_FLAGS=--test-napari
passenv = TOXENV,CI,CODECOV_*,GITHUB_ACTIONS,PYTEST_FLAGS,DISPLAY,XAUTHORITY,MPLBACKEND
usedevelop = true
commands =
python -m pytest --cov --cov-append --cov-report=xml --cov-config={toxinidir}/tox.ini --ignore docs/ {posargs:-vv} {env:PYTEST_FLAGS:}
[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{38,39,310}-{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.9
deps = pre-commit>=3.0.4
skip_install = true
commands = pre-commit run --all-files --show-diff-on-failure {posargs:}
[testenv:clean-docs]
description = Clean the documentation artifacts.
basepython = python3.9
deps =
skip_install = true
changedir = {toxinidir}/docs
allowlist_externals = make
commands = make clean
[testenv:check-docs]
description = Check whether the links in the documentation are valid.
basepython = python3.9
deps = -r{toxinidir}/docs/requirements.txt
skip_install = true
allowlist_externals = sphinx-build
passenv = SQUIDPY_DOWNLOAD_NOTEBOOKS,PYENCHANT_LIBRARY_PATH
commands =
sphinx-build -W --keep-going -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.9
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:build-release-notes]
description = Build release notes. Used when a new release happens.
basepython = python3.9
deps =
towncrier
usedevelop = true
allowlist_externals = rm
commands =
towncrier build --yes {posargs:} --version="dev"
rm -f {toxinidir}/docs/source/release/notes-dev.rst
towncrier build --yes --version="dev"
[testenv:readme]
description = Check if README renders on PyPI.
basepython = python3.9
deps = twine >= 1.12.1
skip_install = true
commands = pip wheel -q -w {envtmpdir}/build --no-deps .
twine check {envtmpdir}/build/*
[testenv:download-data]
description = Download and cache data.
; basepython = python3.9
skip_install = false
deps = -r{toxinidir}/requirements.txt
commands = python ./.scripts/ci/download_data.py {posargs}