-
Notifications
You must be signed in to change notification settings - Fork 63
/
tox.ini
261 lines (224 loc) · 7.11 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
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
; By default, testenvs are configured to:
; - don't skip dist (skipsdist = False)
; - don't skip the package installation (skip_install = False)
; - don't use source installation (usedevelop = False)
; where one of those steps is not necessary for the test,
; we set the associated flag (e.g. for linting we don't need
; the package installation).
[tox]
envlist = bandit, black, black-check, isort, isort-check, copyright_check, docs, flake8, liccheck, mypy, py{3.8,3.9,3.10}, dependencies_check, plugins_deps
isolated_build = True
[testenv]
basepython = python3
allowlist_externals =
/bin/sh
make
passenv = *
extras = all
deps = poetry
commands =
poetry install --only testing,main,packages -E all
poetry run pip install openapi-core==0.13.2
poetry run python ./install_packages.py jsonschema
poetry run python -m pip install file://{toxinidir}/plugins/aea-ledger-ethereum
poetry run python -m pip install file://{toxinidir}/plugins/aea-ledger-cosmos
poetry run python -m pip install file://{toxinidir}/plugins/aea-ledger-fetchai
poetry run python -m pip install file://{toxinidir}/plugins/aea-cli-ipfs
poetry run python ./install_packages.py black isort
poetry run pytest -rfE --cov=aea --cov-report=html --cov-report=term-missing --cov-config=pyproject.toml {posargs}
[testenv:py3.8]
basepython = python3.8
[testenv:py3.8-cov]
basepython = python3.8
usedevelop = True
[testenv:py3.9]
basepython = python3.9
[testenv:py3.10]
basepython = python3.10
[plugins]
commands =
poetry install --only main,testing -E all
poetry run python -m pip install file://{toxinidir}/plugins/aea-ledger-ethereum
poetry run python -m pip install file://{toxinidir}/plugins/aea-ledger-cosmos
poetry run python -m pip install file://{toxinidir}/plugins/aea-ledger-fetchai
poetry run python -m pip install file://{toxinidir}/plugins/aea-cli-ipfs
poetry run pytest -rfE plugins/aea-ledger-fetchai/tests --cov-report=html --cov-report=term-missing --cov=aea_ledger_fetchai --cov-config=pyproject.toml --suppress-no-test-exit-code {posargs}
poetry run pytest -rfE plugins/aea-ledger-ethereum/tests --cov-report=html --cov-report=term-missing --cov=aea_ledger_ethereum --cov-config=pyproject.toml --suppress-no-test-exit-code {posargs}
poetry run pytest -rfE plugins/aea-ledger-cosmos/tests --cov-report=html --cov-report=term-missing --cov=aea_ledger_cosmos --cov-config=pyproject.toml --suppress-no-test-exit-code {posargs}
poetry run pytest -rfE plugins/aea-cli-ipfs/tests --cov-report=html --cov-report=term-missing --cov=aea_cli_ipfs --cov-config=pyproject.toml --suppress-no-test-exit-code {posargs}
[testenv:plugins-py3.8]
basepython = python3.8
commands = {[plugins]commands}
[testenv:plugins-py3.9]
basepython = python3.9
commands = {[plugins]commands}
[testenv:plugins-py3.10]
basepython = python3.10
commands = {[plugins]commands}
[testenv:plugins-py3.8-cov]
basepython = python3.8
usedevelop = True
commands = {[plugins]commands}
[testenv:bandit]
skipsdist = True
skip_install = True
commands =
poetry run python ./install_packages.py bandit
make bandit
[testenv:check_plugins_code_consistency]
skipsdist = True
skip_install = True
allowlist_externals =
diff
commands =
make plugin-diffs
[testenv:check_go_code_consistency]
skipsdist = True
skip_install = True
allowlist_externals =
diff
commands =
make libp2p-diffs
[testenv:black]
skipsdist = True
skip_install = True
commands =
poetry run python ./install_packages.py black
make black
[testenv:black-check]
skipsdist = True
skip_install = True
commands =
poetry run python ./install_packages.py black
make black-check
[testenv:isort]
skipsdist = True
skip_install = True
commands =
poetry run python ./install_packages.py isort
make isort
[testenv:isort-check]
skipsdist = True
skip_install = True
commands =
poetry run python ./install_packages.py isort
make isort-check
[testenv:copyright_check]
skipsdist = True
skip_install = True
commands =
python {toxinidir}/scripts/check_copyright_notice.py --directory {toxinidir}
[testenv:hash_check]
skipsdist = True
usedevelop = True
commands =
poetry run python ./install_packages.py ipfshttpclient
poetry run python {toxinidir}/scripts/generate_ipfs_hashes.py --check {posargs}
[testenv:package_version_checks]
skipsdist = True
usedevelop = True
deps =
commands = make check-package-versions-in-docs
[testenv:package_dependencies_checks]
skipsdist = True
usedevelop = True
deps =
commands = make check-packages
[testenv:docs]
skipsdist = True
skip_install = True
commands =
poetry install --only docs
make docs
[testenv:docs-serve]
skipsdist = True
skip_install = True
commands =
poetry install --only docs
poetry run mkdocs serve -a localhost:8080
[testenv:flake8]
skipsdist = True
skip_install = True
commands =
poetry run python ./install_packages.py "flake8.*" pydocstyle darglint
make flake8
[testenv:liccheck]
skipsdist = True
commands =
poetry install --only packages,main
poetry run python ./install_packages.py liccheck
make liccheck
[testenv:mypy]
skipsdist = True
skip_install = True
commands =
poetry install --only packages,main,testing,types
poetry run python ./install_packages.py mypy
make mypy
[testenv:pylint]
skipsdist = True
commands =
poetry run python ./install_packages.py pylint pytest gitpython
# pytest gitpython installed for scripts and aea testing tools source code checks
poetry run python -m pip install --no-deps file://{toxinidir}/plugins/aea-ledger-ethereum
poetry run python -m pip install --no-deps file://{toxinidir}/plugins/aea-ledger-cosmos
poetry run python -m pip install --no-deps file://{toxinidir}/plugins/aea-ledger-fetchai
poetry run python -m pip install --no-deps file://{toxinidir}/plugins/aea-cli-ipfs
make pylint
[testenv:safety]
skipsdist = True
skip_install = True
commands =
poetry run python ./install_packages.py safety
make safety
[testenv:vulture]
skipsdist = True
skip_install = True
commands =
poetry run python ./install_packages.py vulture
make vulture
[testenv:check-doc-links]
skipsdist = True
usedevelop = True
deps =
commands = make check-doc-links
[testenv:check_api_docs]
skipsdist = True
usedevelop = True
commands =
poetry run python ./install_packages.py pydoc-markdown
poetry run {toxinidir}/scripts/generate_api_docs.py --check-clean
[testenv:check_generate_all_protocols]
skipsdist = True
usedevelop = True
setenv =
PYTHONPATH = {toxinidir}
commands =
poetry run pip install .[all]
poetry run python ./install_packages.py black isort ipfshttpclient
poetry run ./scripts/generate_all_protocols.py --no-bump --check-clean
[testenv:spell_check]
skipsdist = True
usedevelop = True
allowlist_externals =
**/spell-check.sh
deps =
commands = {toxinidir}/scripts/spell-check.sh
[testenv:dependencies_check]
skipsdist = True
skip_install = True
commands =
pip install {toxinidir}[all]
pip uninstall aea -y
python {toxinidir}/scripts/check_imports_and_dependencies.py
[testenv:plugins_env]
skipsdist = True
skip_install = True
passenv = *
deps =
.[all]
allowlist_externals =
**/sh
commands =
- /bin/sh -c "rm -fr ./*private_key.txt"
{posargs}