forked from nilearn/nilearn
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtox.ini
157 lines (141 loc) · 3.88 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
; See https://tox.wiki/en
[tox]
requires =
tox>=4
; run lint by default when just calling "tox"
env_list = lint
; ENVIRONMENTS
; ------------
[style]
description = common environment for style checkers (rely on pre-commit hooks)
skip_install = true
deps =
pre-commit
flake8
flake8-functions
[min]
description = environment with minimum versions of all dependencies (plotting not included)
skip_install = false
deps =
joblib==1.0.0
nibabel==4.0.0
numpy==1.19.0
pandas==1.1.5
scikit-learn==1.0.0
scipy==1.8.0
[plotmin]
description = environment with minimum matplotlib version
skip_install = false
deps =
matplotlib==3.3.0
[matplotlib]
description = environment with matplotlib dependencies
skip_install = false
deps =
matplotlib>=3.3.0
[plotting]
description = environment with all plotting dependencies
skip_install = false
deps =
{[matplotlib]deps}
kaleido
plotly
kaleido ; platform_system != 'Windows'
kaleido==0.1.0.post1 ; platform_system == 'Windows'
; COMMANDS
; --------
[testenv:lint]
description = run all linters and formatters
skip_install = true
deps =
{[style]deps}
commands =
pre-commit run --all-files --show-diff-on-failure {posargs:}
; TODO add this to pre-commit or remove when all functions have been shortened.
flake8 --select CFQ001 --max-function-length 181 nilearn/**/tests
[testenv:flake8]
description = run flake8
skip_install = true
deps =
{[style]deps}
commands =
pre-commit run --all-files --show-diff-on-failure flake8
; TODO add this to pre-commit or remove when all functions have been shortened.
flake8 --select CFQ001 --max-function-length 181 nilearn/**/tests
[testenv:test_latest]
description = run tests on latest version of all dependencies (plotting not included)
passenv = USERNAME
extras = test
commands =
pytest --cov=nilearn --cov-report=xml {posargs:}
[testenv:test_plotting]
description = run tests on latest version of all dependencies
passenv = USERNAME
extras = test
deps =
{[plotting]deps}
commands =
{[testenv:test_latest]commands}
{[testenv:test_doc]commands}
[testenv:test_doc]
description = run tests on doc
passenv = USERNAME
extras = test
deps =
{[plotting]deps}
commands =
pytest doc/_additional_doctests.txt
; TODO find a way to rely on globbing instead of listing a specific folder
pytest --doctest-glob='*.rst' doc/manipulating_images/
[testenv:test_pre]
description = run test_latest and test_doc on pre-release version of all dependencies
passenv =
USERNAME
pip_pre = true
extras = test
deps =
{[plotting]deps}
commands =
{[testenv:test_latest]commands}
{[testenv:test_doc]commands}
[testenv:test_min]
description = run tests on minimum version of all dependencies (plotting not included)
passenv = USERNAME
extras = test
deps =
{[min]deps}
commands =
{[testenv:test_latest]commands}
[testenv:test_plot_min]
description = run tests on minimum version of all dependencies (no plotly).
Plotly is additional for supporting interactive plots
but is not actually needed to use nilearn plotting functionality
passenv = USERNAME
extras = test
deps =
{[min]deps}
{[plotmin]deps}
commands =
{[testenv:test_latest]commands}
[testenv:test_randomize]
description = run all tests in a random order
passenv = USERNAME
extras = test
deps =
{[plotting]deps}
pytest-random-order
commands =
pytest --pyargs nilearn --random-order {posargs:}
[testenv:test_numpy2]
description = run tests on latest version of all dependencies
passenv = USERNAME
setenv =
nightlies_url=https://pypi.anaconda.org/scientific-python-nightly-wheels/simple
extras = test
deps =
{[plotting]deps}
commands =
pip install git+https://github.com/nipy/nibabel
pip install --pre --upgrade -i {env:nightlies_url} pandas scipy scikit-learn matplotlib
pip install --pre --upgrade -i {env:nightlies_url} numpy
pytest {posargs:}