forked from fetchai/agents-aea
-
Notifications
You must be signed in to change notification settings - Fork 16
/
tox.ini
489 lines (428 loc) · 16.9 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
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
; 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, safety, black, black-check, isort, isort-check, fix-copyright, check-copyright, hash-check, docs, flake8, liccheck, mypy, pylint, vulture, {plugins-,}py{3.8,3.9,3.10,3.10-cov,3.11}, dependencies-check, package-version-checks, lock-packages, package-dependencies-checks, plugins_deps, fix-doc-hashes, check-doc-links-hashes, check-generate-all-protocols, spell-check, generate-api-documentation
; when running locally we don't want to fail for no good reason
skip_missing_interpreters = true
[packages-deps]
deps =
gym==0.15.6
aiohttp<4.0.0,>=3.8.5
gym==0.15.6
hypothesis==6.21.6
numpy>=1.18.1
openapi-core==0.15.0
openapi-spec-validator<0.5.0,>=0.4.0
asn1crypto<1.5.0,>=1.4.0
tomte[tests]==0.2.13
[tests-common]
deps =
{[packages-deps]deps}
docker==4.2.0
pexpect==4.8.0
GitPython<4.0.0,>=3.1.37
packaging<24.0,>=23.1
py-multibase>=1.0.0
py-multicodec>=0.2.0
protobuf<4.25.0,>=4.21.6
requests==2.28.1
mistune==2.0.3
tomte[isort]==0.2.13
tomte[black]==0.2.13
tomte[tests]==0.2.13
; Plugin dependencies. We need this
; because we use --no-deps to install the plugins.
; aea_ledger_cosmos/aea_ledger_fetchai
ecdsa>=0.15
asn1crypto<1.5.0,>=1.4.0
bech32==1.2.0
; aea_ledger_ethereum
web3<7,>=6.0.0
ipfshttpclient==0.8.0a2
eth-account<0.9.0,>=0.8.0
; for password encryption in cosmos
pycryptodome>=3.10.1
cosmpy==0.9.2
certifi<=2022.6.15.1
google-api-python-client<=2.60.0
idna<=3.3
numpy>=1.18.1
psutil==5.7.0
setuptools==59.6.0
ledgerwallet==0.1.3
construct<=2.10.61
defusedxml==0.6.0
semver<3.0.0,>=2.9.1
[extra-deps]
deps =
memory-profiler==0.57.0
multidict
pytest-asyncio
werkzeug
; end-extra
[testenv]
basepython = python3.10
whitelist_externals = /bin/sh
passenv = *
extras = all
deps =
setuptools==59.6.0
[commands-local-install]
commands =
pip install {toxinidir}[all]
python -m pip install --no-deps file://{toxinidir}/plugins/aea-ledger-ethereum
python -m pip install --no-deps file://{toxinidir}/plugins/aea-ledger-cosmos
python -m pip install --no-deps file://{toxinidir}/plugins/aea-ledger-fetchai
python -m pip install --no-deps file://{toxinidir}/plugins/aea-cli-ipfs
[test-framework]
deps =
{[tests-common]deps}
commands =
; for some reason tox installs aea without respect to the dependencies version specified in seetup.py. at least in CI env
; so install current aea in a normal way
{[commands-local-install]commands}
pytest -rfE --doctest-modules aea tests/ --durations=0 --cov=aea --cov-report=html --cov-report=xml --cov-report=term --cov-report=term-missing --cov-config=.coveragerc --cov-append {posargs}
[test-packages]
deps =
{[tests-common]deps}
commands =
; for some reason tox installs aea without respect to the dependencies version specified in setup.py. at least in CI env
; so install current aea in a normal way
{[commands-local-install]commands}
aea test --cov --append packages --durations=0 {posargs}
[test-plugins]
deps =
{[tests-common]deps}
pytest-custom-exit-code==0.3.0
hexbytes==0.3.0
commands =
{[commands-local-install]commands}
pytest -rfE plugins/aea-ledger-fetchai/tests --durations=0 --cov-report=html --cov-report=xml --cov-report=term --cov-report=term-missing --cov=aea_ledger_fetchai --cov-config=.coveragerc --suppress-no-test-exit-code --cov-append {posargs}
pytest -rfE plugins/aea-ledger-ethereum/tests --durations=0 --cov-report=html --cov-report=xml --cov-report=term --cov-report=term-missing --cov=aea_ledger_ethereum --cov-config=.coveragerc --suppress-no-test-exit-code --cov-append {posargs}
pytest -rfE plugins/aea-ledger-cosmos/tests --durations=0 --cov-report=html --cov-report=xml --cov-report=term --cov-report=term-missing --cov=aea_ledger_cosmos --cov-config=.coveragerc --suppress-no-test-exit-code --cov-append {posargs}
pytest -rfE plugins/aea-cli-ipfs/tests --durations=0 --cov-report=html --cov-report=xml --cov-report=term --cov-report=term-missing --cov=aea_cli_ipfs --cov-config=.coveragerc --suppress-no-test-exit-code --cov-append {posargs}
python -m pip install --no-deps file://{toxinidir}/plugins/aea-ledger-ethereum-hwi
pytest -rfE plugins/aea-ledger-ethereum-hwi/tests --durations=0 --cov-report=html --cov-report=xml --cov-report=term --cov-report=term-missing --cov=aea_ledger_ethereum_hwi --cov-config=.coveragerc --suppress-no-test-exit-code --cov-append {posargs}
[test-plugins-lte-3.9]
deps =
{[tests-common]deps}
pytest-custom-exit-code==0.3.0
open-aea-flashbots==1.4.0
commands =
{[commands-local-install]commands}
pytest -rfE plugins/aea-ledger-fetchai/tests --durations=0 --cov-report=html --cov-report=xml --cov-report=term --cov-report=term-missing --cov=aea_ledger_fetchai --cov-config=.coveragerc --suppress-no-test-exit-code --cov-append {posargs}
pytest -rfE plugins/aea-ledger-ethereum/tests --durations=0 --cov-report=html --cov-report=xml --cov-report=term --cov-report=term-missing --cov=aea_ledger_ethereum --cov-config=.coveragerc --suppress-no-test-exit-code --cov-append {posargs}
pytest -rfE plugins/aea-ledger-cosmos/tests --durations=0 --cov-report=html --cov-report=xml --cov-report=term --cov-report=term-missing --cov=aea_ledger_cosmos --cov-config=.coveragerc --suppress-no-test-exit-code --cov-append {posargs}
pytest -rfE plugins/aea-cli-ipfs/tests --durations=0 --cov-report=html --cov-report=xml --cov-report=term --cov-report=term-missing --cov=aea_cli_ipfs --cov-config=.coveragerc --suppress-no-test-exit-code --cov-append {posargs}
python -m pip install --no-deps file://{toxinidir}/plugins/aea-ledger-ethereum-hwi
pytest -rfE plugins/aea-ledger-ethereum-hwi/tests --durations=0 --cov-report=html --cov-report=xml --cov-report=term --cov-report=term-missing --cov=aea_ledger_ethereum_hwi --cov-config=.coveragerc --suppress-no-test-exit-code --cov-append {posargs}
python -m pip install --no-deps file://{toxinidir}/plugins/aea-ledger-ethereum-flashbots
pytest -rfE plugins/aea-ledger-ethereum-flashbots/tests --durations=0 --cov-report=html --cov-report=xml --cov-report=term --cov-report=term-missing --cov=aea_ledger_ethereum_flashbots --cov-config=.coveragerc --suppress-no-test-exit-code --cov-append {posargs}
python -m pip install file://{toxinidir}/plugins/aea-ledger-solana
pytest -rfE plugins/aea-ledger-solana/tests --durations=0 --cov-report=html --cov-report=xml --cov-report=term --cov-report=term-missing --cov=aea_ledger_solana --cov-config=.coveragerc --suppress-no-test-exit-code --cov-append {posargs}
[testenv:py3.10]
basepython = python3.10
usedevelop = True
deps = {[test-framework]deps}
commands = {[test-framework]commands}
[testenv:packages-py3.10]
basepython = python3.10
deps = {[test-packages]deps}
commands = {[test-packages]commands}
[testenv:plugins-py3.10]
basepython = python3.10
usedevelop = True
deps = {[test-plugins-lte-3.9]deps}
commands = {[test-plugins-lte-3.9]commands}
; Since the ledgerwallet still uses protobufs compiled using protoc<=3.20
setenv =
PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION=python
[testenv:py3.11]
basepython = python3.11
usedevelop = True
deps = {[test-framework]deps}
commands = {[test-framework]commands}
[testenv:packages-py3.11]
basepython = python3.11
deps = {[test-packages]deps}
commands = {[test-packages]commands}
[testenv:plugins-py3.11]
basepython = python3.11
usedevelop = True
deps = {[test-plugins-lte-3.9]deps}
commands = {[test-plugins-lte-3.9]commands}
; Since the ledgerwallet still uses protobufs compiled using protoc<=3.20
setenv =
PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION=python
[testenv:bandit]
skipsdist = True
skip_install = True
deps =
tomte[bandit]==0.2.13
commands = bandit -r aea benchmark examples \
plugins/aea-ledger-fetchai/aea_ledger_fetchai \
plugins/aea-ledger-ethereum/aea_ledger_ethereum \
plugins/aea-ledger-ethereum-flashbots/aea-ledger-ethereum-flashbots \
plugins/aea-ledger-cosmos/aea_ledger_cosmos \
plugins/aea-ledger-solana/aea_ledger_solana \
plugins/aea-cli-ipfs/aea_cli_ipfs
bandit -s B101 -r packages
bandit -s B101 -r tests scripts
[testenv:black]
skipsdist = True
skip_install = True
deps =
tomte[black]==0.2.13
commands = black aea benchmark examples packages plugins scripts tests --exclude ".*_pb2.py"
[testenv:black-check]
skipsdist = True
skip_install = True
deps =
tomte[black]==0.2.13
commands =black aea benchmark examples packages plugins scripts tests --check --verbose --exclude ".*_pb2.py"
[testenv:isort]
skipsdist = True
skip_install = True
deps =
tomte[isort]==0.2.13
commands = isort aea benchmark examples packages plugins scripts tests
[testenv:isort-check]
skipsdist = True
skip_install = True
deps =
tomte[isort]==0.2.13
commands = isort --check-only --verbose aea benchmark examples packages plugins scripts tests
[testenv:fix-copyright]
skipsdist = True
skip_install = True
deps =
commands = {toxinidir}/scripts/check_copyright_notice.py
[testenv:check-copyright]
skipsdist = True
skip_install = True
deps =
commands = {toxinidir}/scripts/check_copyright_notice.py --check
[testenv:hash-check]
skipsdist = True
usedevelop = True
commands =
pip install {toxinidir}[all]
python -m pip install --no-deps file://{toxinidir}/plugins/aea-cli-ipfs
aea packages lock --check
aea --registry-path=./tests/data/packages packages lock --check
[testenv:lock-packages]
skipsdist = True
usedevelop = True
commands =
pip install {toxinidir}[all]
python -m pip install --no-deps file://{toxinidir}/plugins/aea-cli-ipfs
aea packages lock
aea --registry-path=./tests/data/packages packages lock
python {toxinidir}/scripts/check_doc_ipfs_hashes.py --fix
[testenv:package-version-checks]
skipsdist = True
usedevelop = True
deps =
commands = {toxinidir}/scripts/check_package_versions_in_docs.py
[testenv:package-dependencies-checks]
skipsdist = True
usedevelop = True
deps =
{[testenv]deps}
{[packages-deps]deps}
commands =
python -m pip install --no-deps file://{toxinidir}/plugins/aea-ledger-ethereum
python -m pip install --no-deps file://{toxinidir}/plugins/aea-ledger-ethereum-flashbots
python -m pip install --no-deps file://{toxinidir}/plugins/aea-ledger-cosmos
python -m pip install --no-deps file://{toxinidir}/plugins/aea-ledger-fetchai
python -m aea.cli check-packages
[testenv:docs]
skipsdist = True
skip_install = True
deps =
tomte[docs]==0.2.13
commands = pip3 install git+https://github.com/pugong/mkdocs-mermaid-plugin.git#egg=mkdocs-mermaid-plugin
mkdocs build --clean
[testenv:docs-serve]
skipsdist = True
skip_install = True
deps =
tomte[docs]==0.2.13
commands = pip3 install git+https://github.com/pugong/mkdocs-mermaid-plugin.git#egg=mkdocs-mermaid-plugin
mkdocs build --clean
python -c 'print("###### Starting local server. Press Control+C to stop server ######")'
mkdocs serve -a localhost:8080
[testenv:flake8]
skipsdist = True
skip_install = True
deps =
tomte[flake8]==0.2.13
commands = flake8 aea benchmark examples packages plugins scripts tests
[testenv:liccheck]
skipsdist = True
usedevelop = True
deps =
liccheck==0.6.0
commands = {toxinidir}/scripts/freeze_dependencies.py -o {envtmpdir}/requirements.txt
liccheck -s strategy.ini -r {envtmpdir}/requirements.txt -l PARANOID
[testenv:mypy]
skipsdist = True
skip_install = True
deps =
tomte[mypy]==0.2.13
commands = mypy aea packages --disallow-untyped-defs
mypy benchmark examples --disallow-untyped-defs
mypy scripts tests plugins/aea-ledger-fetchai/aea_ledger_fetchai plugins/aea-ledger-ethereum/aea_ledger_ethereum plugins/aea-ledger-ethereum-flashbots/aea_ledger_ethereum_flashbots plugins/aea-ledger-cosmos/aea_ledger_cosmos plugins/aea-cli-ipfs/aea_cli_ipfs
[testenv:pylint]
whitelist_externals =
/bin/sh
/usr/bin/sh
skipsdist = True
deps =
tomte[pylint]==0.2.13
commands =
python -m pip install --no-deps file://{toxinidir}/plugins/aea-ledger-ethereum
python -m pip install --no-deps file://{toxinidir}/plugins/aea-ledger-ethereum-flashbots
python -m pip install --no-deps file://{toxinidir}/plugins/aea-ledger-cosmos
python -m pip install --no-deps file://{toxinidir}/plugins/aea-ledger-fetchai
python -m pip install --no-deps file://{toxinidir}/plugins/aea-ledger-solana
python -m pip install --no-deps file://{toxinidir}/plugins/aea-cli-ipfs
sh -c "pylint aea benchmark packages plugins/aea-ledger-fetchai/aea_ledger_fetchai plugins/aea-ledger-ethereum/aea_ledger_ethereum plugins/aea-ledger-ethereum-flashbots/aea_ledger_ethereum_flashbots plugins/aea-ledger-cosmos/aea_ledger_cosmos plugins/aea-cli-ipfs/aea_cli_ipfs scripts examples/*"
[testenv:safety]
skipsdist = True
skip_install = True
deps =
tomte[safety]==0.2.13
commands = safety check -i 37524 -i 38038 -i 37776 -i 38039 -i 39621 -i 40291 -i 39706 -i 51358 -i 51499 -i 67599 -i 70612
[testenv:vulture]
skipsdist = True
skip_install = True
deps =
tomte[vulture]==0.2.13
commands = vulture aea scripts/whitelist.py --exclude "*_pb2.py"
[testenv:darglint]
skipsdist = True
skip_install = True
deps =
tomte[darglint]==0.2.13
commands = darglint aea benchmark examples libs packages plugins scripts
[testenv:fix-doc-hashes]
skipsdist = True
usedevelop = True
commands = {toxinidir}/scripts/generate_package_list.py
{toxinidir}/scripts/check_doc_ipfs_hashes.py --fix
[testenv:check-doc-links-hashes]
skipsdist = True
usedevelop = True
commands = {toxinidir}/scripts/check_doc_links.py
{toxinidir}/scripts/check_doc_ipfs_hashes.py
{toxinidir}/scripts/check_ipfs_hashes_pushed.py
[testenv:generate-all-protocols]
skipsdist = True
usedevelop = True
deps =
tomte[isort]==0.2.13
tomte[black]==0.2.13
commands = pip install {toxinidir}[all]
pip install --no-deps file://{toxinidir}/plugins/aea-cli-ipfs
aea generate-all-protocols
aea generate-all-protocols tests/data/packages
[testenv:check-generate-all-protocols]
skipsdist = True
usedevelop = True
deps =
tomte[isort]==0.2.13
tomte[black]==0.2.13
commands = pip install {toxinidir}[all]
python -m pip install --no-deps file://{toxinidir}/plugins/aea-cli-ipfs
aea generate-all-protocols --check-clean
aea generate-all-protocols tests/data/packages --check-clean
[testenv:spell-check]
whitelist_externals = mdspell
skipsdist = True
usedevelop = True
deps =
commands = mdspell -r -n -a --en-gb '**/*.md' '!docker-images/*.md' '!docs/api/**/*.md' '!docs/package_list.md'
[testenv:dependencies-check]
skipsdist = True
skip_install = True
commands =
pip install {toxinidir}[all]
pip uninstall open-aea -y
{toxinidir}/scripts/check_imports_and_dependencies.py
[testenv:plugins_env]
skipsdist = True
skip_install = True
passenv = *
deps = .[all]
whitelist_externals = /bin/sh
commands =
- /bin/sh -c "rm -fr ./*private_key.txt"
{posargs}
[testenv_multi]
basepython = python3
whitelist_externals = /bin/sh
passenv = *
extras = all
deps = {[tests-common]deps}
[testenv:py3.8]
basepython = python3.8
deps = {[testenv_multi]deps}
commands = {[test-framework]commands}
[testenv:packages-py3.8]
basepython = python3.8
deps = {[testenv_multi]deps}
commands = {[test-packages]commands}
[testenv:py3.9]
basepython = python3.9
deps = {[testenv_multi]deps}
commands = {[test-framework]commands}
[testenv:packages-py3.9]
basepython = python3.9
deps = {[testenv_multi]deps}
commands = {[test-packages]commands}
[testenv:plugins-py3.8]
basepython = python3.8
deps =
{[testenv_multi]deps}
pytest-custom-exit-code==0.3.0
commands = {[test-plugins]commands}
; Since the ledgerwallet still uses protobufs compiled using protoc<=3.20
setenv =
PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION=python
[testenv:plugins-py3.9]
basepython = python3.9
deps = {[test-plugins-lte-3.9]deps}
commands = {[test-plugins-lte-3.9]commands}
; Since the ledgerwallet still uses protobufs compiled using protoc<=3.20
setenv =
PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION=python
[testenv:check-api-docs]
skipsdist = True
usedevelop = True
deps =
tomte[docs]==0.2.13
docspec==2.2.1
docspec-python==2.2.1
commands = {toxinidir}/scripts/generate_api_docs.py --check-clean
[testenv:generate-api-documentation]
skipsdist = True
usedevelop = True
deps =
tomte[docs]==0.2.13
docspec==2.2.1
docspec-python==2.2.1
commands = {toxinidir}/scripts/generate_api_docs.py
[testenv:update-dependencies]
deps =
toml==0.10.2
commands = {toxinidir}/scripts/check_dependencies.py
[testenv:check-dependencies]
deps =
toml==0.10.2
commands = {toxinidir}/scripts/check_dependencies.py --check