forked from theislab/cellrank
-
Notifications
You must be signed in to change notification settings - Fork 0
/
tox.ini
215 lines (195 loc) · 5.39 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
[flake8]
per-file-ignores =
*/*.py: F401,D104,D100
examples/*: D400,D205,D100
docs/source/index.rst: D000
cellrank/_utils/_key.py: D101,D102,D106
max_line_length = 120
filename = *.py
# D202 No blank lines allowed after function docstring
# 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 ':'
# F405 ... may be undefined, or defined from star imports: ...
# RST306 Unknown target name
# D106 Missing docstring in public nested class
# B020 Found for loop that reassigns the iterable it is iterating with each iterable value
# B024: https://github.com/PyCQA/flake8-bugbear/issues/278
ignore = D202,D107,B008,W503,D105,E203,F405,RST306,B020,B024
exclude =
.git,
__pycache__,
docs/*,
tests/*,
setup.py
ban-relative-imports = true
rst-roles =
mod
class
meth
func
attr
ref
rst-directives =
envvar
exception
[doc8]
max-line-length = 120
ignore-path = .tox,docs/source/api,cellrank.egg-info,dist,build,docs/source/release/**
# D000: D000 Unknown target name:
ignore-path-errors = docs/source/index.rst;D000,docs/source/latest_additions.rst;D000,docs/source/release_notes.rst;D000
quiet = 1
[pytest]
python_files = test_*.py
testpaths = tests/
xfail_strict = true
addopts = --ignore _ground_truth_figures --ignore _ground_truth_adatas -n auto -vv
[coverage:run]
branch = true
parallel = true
source = cellrank
omit =
tests/*
*/__init__.py
[coverage:paths]
source =
cellrank
*/site-packages/cellrank
[coverage:report]
exclude_lines =
\#.*pragma:\s*no.?cover
^if __name__ == .__main__.:$
^\s*raise AssertionError\b
^\s*raise NotImplementedError\b
^\s*return NotImplemented\b
ignore_errors = True
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
USE_SLEPC =
true: slepc
false: noslepc
[tox]
isolated_build = True
envlist =
covclean
lint
py{38,39,310}-{linux,macos}-{slepc,noslepc}
coverage
docs
skip_missing_interpreters = true
[testenv]
platform =
linux: linux
macos: (osx|darwin)
deps =
adjustText
linux: rpy2>=3.3.0
linux: git+https://github.com/broadinstitute/wot@master
# https://github.com/theislab/cellrank/pull/850
slepc: numpy==1.21.0
# we manually install PETSc/SLEPc on the CI from source
slepc: mpi4py>=3.0.3
slepc: petsc==3.18.0
slepc: petsc4py==3.18.0
slepc: slepc==3.18.0
slepc: slepc4py==3.18.0
extras =
test
py38: external
passenv = TOXENV,CI,CODECOV_*,GITHUB_ACTIONS,PYTEST_FLAGS,PETSC_*,SLEPC_*
usedevelop = true
commands =
python -m pytest --cov --cov-append --cov-report=term-missing --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}-{slepc,noslepc}
parallel_show_output = True
commands =
coverage report --omit="tox/*"
coverage xml --omit="tox/*" -o {toxinidir}/coverage.xml
diff-cover --compare-branch origin/master {toxinidir}/coverage.xml
[testenv:lint]
description = Perform linting.
basepython = python3.9
deps = pre-commit>=2.9.3
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
extras =
docs
allowlist_externals = sphinx-build
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.
deps =
extras = docs
allowlist_externals = make
changedir = {tox_root}{/}docs
commands =
make html {posargs}
commands_post =
python -c 'import pathlib; print("Documentation is under:", pathlib.Path("{tox_root}") / "docs" / "_build" / "html" / "index.html")'
[testenv:news]
description = Create news fragment from a PR.
basepython = python3.9
skip_install = true
deps = requests
commands =
python {toxinidir}/docs/source/create_news_fragment.py {posargs:}
[testenv:update-dev-notes]
description = Update development release notes.
basepython = python3.9
deps = towncrier
usedevelop = true
allowlist_externals =
rm
git
commands =
rm -f {toxinidir}/docs/source/release/notes-dev.rst
towncrier build --yes --version dev
git reset -- {toxinidir}/docs/source/release/changelog/
git checkout -- {toxinidir}/docs/source/release/changelog/
[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:}
rm -f {toxinidir}/docs/source/release/notes-dev.rst
towncrier build --yes --version dev