-
Notifications
You must be signed in to change notification settings - Fork 0
/
tox.ini
584 lines (499 loc) · 16.4 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
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
; 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, check-hash, check-packages, check-pipfiles, flake8, mypy, pylint, darglint, check-generate-all-protocols, abci-docstrings, check-abciapp-specs, py{3.8,3.9,3.11}-{win,linux,darwin}
; when running locally we don't want to fail for no good reason
skip_missing_interpreters = true
[testenv]
basepython = python3
whitelist_externals = /bin/sh
passenv = *
extras = all
deps =
aiohttp<4.0.0,>=3.8.5
asn1crypto==1.5.1
certifi==2021.10.8
grpcio==1.53.0
hypothesis==6.21.6
py-ecc==6.0.0
pytz==2022.2.1
pytest==7.2.1
pytest-randomly==3.12.0
pytest-cov==4.0.0
pytest-asyncio==0.20.3
open-aea-flashbots==1.4.0
requests==2.28.1
open-aea==1.48.0
open-aea-ledger-ethereum==1.48.0
open-aea-ledger-cosmos==1.48.0
open-aea-ledger-ethereum-flashbots==1.48.0
open-aea-cli-ipfs==1.48.0
open-aea-test-autonomy==0.14.6
open-autonomy==0.14.6
openapi-core==0.15.0
openapi-spec-validator<0.5.0,>=0.4.0
pandas
protobuf<4.25.0,>=4.21.6
setenv =
PYTHONHASHSEED=0
PACKAGES_PATHS = packages/valory
SKILLS_PATHS = {env:PACKAGES_PATHS}/skills
AGENTS_PATHS = {env:PACKAGES_PATHS}/agents
CONTRACTS_PATHS = {env:PACKAGES_PATHS}/contracts
commands =
autonomy init --reset --author ci --remote --ipfs --ipfs-node "/dns/registry.autonolas.tech/tcp/443/https"
autonomy packages sync
pytest -rfE --doctest-modules {env:CONTRACTS_PATHS}/phuture_harvesting_job {env:CONTRACTS_PATHS}/yearn_factory_harvest_job {env:SKILLS_PATHS}/abstract_round_abci {env:SKILLS_PATHS}/registration_abci {env:SKILLS_PATHS}/reset_pause_abci {env:SKILLS_PATHS}/termination_abci {env:SKILLS_PATHS}/transaction_settlement_abci {env:PACKAGES_PATHS}/agents/ --cov=packages --cov-report=xml --cov-report=term --cov-report=term-missing --cov-config=.coveragerc {posargs}
[testenv:py3.8-linux]
basepython = python3.8
usedevelop = True
deps =
{[testenv]deps}
setenv =
{[testenv]setenv}
[testenv:py3.9-linux]
basepython = python3.9
usedevelop = True
deps =
{[testenv]deps}
setenv =
{[testenv]setenv}
[testenv:py3.10-linux]
basepython = python3.10
platform=^linux$
usedevelop = True
deps =
{[testenv]deps}
setenv =
{[testenv]setenv}
[testenv:py3.11-linux]
basepython = python3.11
platform=^linux$
usedevelop = True
deps =
{[testenv]deps}
setenv =
{[testenv]setenv}
[testenv:py3.8-win]
basepython = python3.8
platform=^win32$
usedevelop = True
deps =
{[testenv]deps}
setenv =
{[testenv]setenv}
[testenv:py3.9-win]
basepython = python3.9
platform=^win32$
usedevelop = True
deps =
{[testenv]deps}
setenv =
{[testenv]setenv}
[testenv:py3.10-win]
basepython = python3.10
platform=^win32$
usedevelop = True
deps =
{[testenv]deps}
setenv =
{[testenv]setenv}
[testenv:py3.11-win]
basepython = python3.11
platform=^win32$
usedevelop = True
deps =
{[testenv]deps}
setenv =
{[testenv]setenv}
[testenv:py3.8-darwin]
basepython = python3.8
platform=^darwin$
usedevelop = True
deps =
{[testenv]deps}
setenv =
{[testenv]setenv}
[testenv:py3.9-darwin]
basepython = python3.9
platform=^darwin$
usedevelop = True
deps =
{[testenv]deps}
setenv =
{[testenv]setenv}
[testenv:py3.10-darwin]
basepython = python3.10
platform=^darwin$
usedevelop = True
deps =
{[testenv]deps}
setenv =
{[testenv]setenv}
[testenv:py3.11-darwin]
basepython = python3.11
platform=^darwin$
usedevelop = True
deps =
{[testenv]deps}
setenv =
{[testenv]setenv}
[testenv:bandit]
skipsdist = True
skip_install = True
deps = tomte[bandit]==0.2.12
commands = bandit -s B101 -r packages
bandit -s B101 -r scripts
[testenv:black]
skipsdist = True
skip_install = True
deps = tomte[black]==0.2.12
commands = black packages scripts
[testenv:black-check]
skipsdist = True
skip_install = True
deps = tomte[black]==0.2.12
commands = black --check packages scripts
[testenv:isort]
skipsdist = True
skip_install = True
deps = tomte[isort]==0.2.12
commands =
isort {env:CONTRACTS_PATHS}/connext_propagate_job
isort {env:CONTRACTS_PATHS}/deposit_manager_job
isort {env:CONTRACTS_PATHS}/keep3r_v2
isort {env:CONTRACTS_PATHS}/keep3r_my_job
isort {env:CONTRACTS_PATHS}/keep3r_test_job
isort {env:CONTRACTS_PATHS}/keep3r_v1
isort {env:CONTRACTS_PATHS}/keep3r_v1_library
isort {env:CONTRACTS_PATHS}/phuture_harvesting_job
isort {env:CONTRACTS_PATHS}/yearn_factory_harvest_job
isort {env:SKILLS_PATHS}/keep3r_abci
isort {env:SKILLS_PATHS}/keep3r_job_abci
isort {env:SKILLS_PATHS}/abstract_round_abci
isort {env:SKILLS_PATHS}/registration_abci
isort {env:SKILLS_PATHS}/reset_pause_abci
isort {env:SKILLS_PATHS}/termination_abci
isort {env:SKILLS_PATHS}/transaction_settlement_abci
isort scripts/
[testenv:isort-check]
skipsdist = True
skip_install = True
deps = tomte[isort]==0.2.12
commands =
isort --check-only {env:CONTRACTS_PATHS}/connext_propagate_job
isort --check-only {env:CONTRACTS_PATHS}/deposit_manager_job
isort --check-only {env:CONTRACTS_PATHS}/keep3r_v2
isort --check-only {env:CONTRACTS_PATHS}/keep3r_my_job
isort --check-only {env:CONTRACTS_PATHS}/keep3r_test_job
isort --check-only {env:CONTRACTS_PATHS}/keep3r_v1
isort --check-only {env:CONTRACTS_PATHS}/keep3r_v1_library
isort --check-only {env:CONTRACTS_PATHS}/phuture_harvesting_job
isort --check-only {env:CONTRACTS_PATHS}/yearn_factory_harvest_job
isort --check-only {env:SKILLS_PATHS}/keep3r_abci
isort --check-only {env:SKILLS_PATHS}/keep3r_job_abci
isort --check-only {env:SKILLS_PATHS}/abstract_round_abci
isort --check-only {env:SKILLS_PATHS}/registration_abci
isort --check-only {env:SKILLS_PATHS}/reset_pause_abci
isort --check-only {env:SKILLS_PATHS}/termination_abci
isort --check-only {env:SKILLS_PATHS}/transaction_settlement_abci
isort --check-only scripts/
[testenv:check-hash]
skipsdist = True
skip_install = True
deps =
{[testenv]deps}
commands = python -m autonomy.cli packages lock --check {posargs}
[testenv:check-packages]
skipsdist = True
skip_install = True
deps = {[testenv]deps}
commands =
autonomy init --reset --author ci --remote --ipfs --ipfs-node "/dns/registry.autonolas.tech/tcp/443/https"
autonomy packages sync
autonomy check-packages
[testenv:flake8]
skipsdist = True
skip_install = True
deps =
tomte[flake8]==0.2.15
commands =
flake8 {env:CONTRACTS_PATHS}/connext_propagate_job {env:SKILLS_PATHS}/keep3r_abci {env:SKILLS_PATHS}/keep3r_job_abci {env:CONTRACTS_PATHS}/deposit_manager_job {env:CONTRACTS_PATHS}/keep3r_v2 {env:CONTRACTS_PATHS}/keep3r_my_job {env:CONTRACTS_PATHS}/keep3r_test_job {env:CONTRACTS_PATHS}/keep3r_v1 {env:CONTRACTS_PATHS}/keep3r_v1_library {env:CONTRACTS_PATHS}/phuture_harvesting_job {env:CONTRACTS_PATHS}/yearn_factory_harvest_job {env:SKILLS_PATHS}/registration_abci {env:SKILLS_PATHS}/reset_pause_abci {env:SKILLS_PATHS}/termination_abci {env:SKILLS_PATHS}/transaction_settlement_abci scripts
[testenv:mypy]
skipsdist = True
skip_install = True
deps =
{[testenv]deps}
tomte[mypy]==0.2.15
types-PyYAML==6.0.12.6
commands = mypy {env:SKILLS_PATHS}/keep3r_abci {env:SKILLS_PATHS}/keep3r_job_abci {env:CONTRACTS_PATHS}/deposit_manager_job {env:CONTRACTS_PATHS}/keep3r_v2 {env:CONTRACTS_PATHS}/keep3r_my_job {env:CONTRACTS_PATHS}/keep3r_test_job {env:CONTRACTS_PATHS}/keep3r_v1 {env:CONTRACTS_PATHS}/keep3r_v1_library {env:CONTRACTS_PATHS}/phuture_harvesting_job {env:CONTRACTS_PATHS}/yearn_factory_harvest_job {env:CONTRACTS_PATHS}/connext_propagate_job {env:SKILLS_PATHS}/registration_abci {env:SKILLS_PATHS}/reset_pause_abci {env:SKILLS_PATHS}/termination_abci {env:SKILLS_PATHS}/transaction_settlement_abci scripts --config-file tox.ini
[testenv:pylint]
whitelist_externals = /bin/sh
skipsdist = True
deps =
{[testenv]deps}
tomte[pylint]==0.2.15
commands =
pylint {env:CONTRACTS_PATHS}/connext_propagate_job {env:SKILLS_PATHS}/keep3r_abci {env:SKILLS_PATHS}/keep3r_job_abci {env:CONTRACTS_PATHS}/deposit_manager_job {env:CONTRACTS_PATHS}/keep3r_v2 {env:CONTRACTS_PATHS}/keep3r_my_job {env:CONTRACTS_PATHS}/keep3r_test_job {env:CONTRACTS_PATHS}/keep3r_v1 {env:CONTRACTS_PATHS}/keep3r_v1_library {env:CONTRACTS_PATHS}/phuture_harvesting_job {env:CONTRACTS_PATHS}/yearn_factory_harvest_job {env:SKILLS_PATHS}/registration_abci {env:SKILLS_PATHS}/reset_pause_abci {env:SKILLS_PATHS}/termination_abci {env:SKILLS_PATHS}/transaction_settlement_abci scripts
[testenv:safety]
skipsdist = True
skip_install = True
deps =
tomte[safety]==0.2.15
commands = safety check -i 37524 -i 38038 -i 37776 -i 38039 -i 39621 -i 40291 -i 39706 -i 41002 -i 51358 -i 51499
[testenv:darglint]
skipsdist = True
skip_install = True
deps =
tomte[darglint]==0.2.15
commands = darglint {env:CONTRACTS_PATHS}/connext_propagate_job {env:SKILLS_PATHS}/keep3r_abci {env:SKILLS_PATHS}/keep3r_job_abci {env:CONTRACTS_PATHS}/deposit_manager_job {env:CONTRACTS_PATHS}/keep3r_v2 {env:CONTRACTS_PATHS}/keep3r_my_job {env:CONTRACTS_PATHS}/keep3r_test_job {env:CONTRACTS_PATHS}/keep3r_v1 {env:CONTRACTS_PATHS}/keep3r_v1_library {env:CONTRACTS_PATHS}/phuture_harvesting_job {env:CONTRACTS_PATHS}/yearn_factory_harvest_job {env:SKILLS_PATHS}/registration_abci {env:SKILLS_PATHS}/reset_pause_abci {env:SKILLS_PATHS}/termination_abci {env:SKILLS_PATHS}/transaction_settlement_abci scripts
[testenv:check-generate-all-protocols]
skipsdist = True
usedevelop = True
deps =
tomte[isort]==0.2.15
tomte[black]==0.2.15
commands = aea generate-all-protocols --check-clean
[testenv:spell-check]
whitelist_externals = mdspell
skipsdist = True
usedevelop = True
deps =
commands = tomte check-spelling
[testenv:abci-docstrings]
skipsdist = True
usedevelop = True
commands = autonomy analyse docstrings --update
[testenv:check-abciapp-specs]
skipsdist = True
usedevelop = True
commands =
# TODO: reactivate this once the ts_abci has Event.BAD_TX
# autonomy init --reset --author ci --remote --ipfs --ipfs-node "/dns/registry.autonolas.tech/tcp/443/https"
# autonomy packages sync
# autonomy analyse fsm-specs
[testenv:check-pipfiles]
skipsdist = True
usedevelop = True
deps =
commands = {toxinidir}/scripts/check_pipfiles.py
[testenv:liccheck]
skipsdist = True
usedevelop = True
deps = tomte[liccheck,cli]==0.2.12
commands =
tomte freeze-dependencies --output-path {envtmpdir}/requirements.txt
liccheck -s tox.ini -r {envtmpdir}/requirements.txt -l PARANOID
[flake8]
paths=packages
exclude=.md,
*_pb2.py,
*_pb2_grpc.py,
custom_types.py,
{env:PACKAGES_PATHS}/connections
{env:CONTRACTS_PATHS}
{env:PACKAGES_PATHS}/protocols
{env:SKILLS_PATHS}/abstract_abci
{env:SKILLS_PATHS}/abstract_round_abci
{env:SKILLS_PATHS}/registration_abci
{env:SKILLS_PATHS}/reset_pause_abci
max-line-length = 88
select = B,C,D,E,F,I,W,
ignore = E203,E501,W503,D202,B014,D400,D401,DAR,F811
application-import-names = packages,tests,scripts
# ignore as too restrictive for our needs:
# D400: First line should end with a period
# D401: First line should be in imperative mood
# E501: https://www.flake8rules.com/rules/E501.html (Line too long)
# E203: https://www.flake8rules.com/rules/E203.html (Whitespace)
# W503: https://www.flake8rules.com/rules/W503.html (Line break)
# D202: blank lines
# B014: redundant exception
[isort]
# for black compatibility
multi_line_output=3
include_trailing_comma=True
force_grid_wrap=0
use_parentheses=True
ensure_newline_before_comments = True
line_length=88
# custom configurations
order_by_type=False
case_sensitive=True
lines_after_imports=2
skip={env:SKILLS_PATHS}/abstract_round_abci/test_tools/integration.py,{env:SKILLS_PATHS}/transaction_settlement_abci/test_tools/integration.py,
skip_glob =
known_first_party=autonomy
known_packages=packages
known_local_folder=tests
sections=FUTURE,STDLIB,THIRDPARTY,FIRSTPARTY,PACKAGES,LOCALFOLDER
[mypy]
python_version = 3.10
strict_optional = True
exclude=(.*_pb2|.*custom_types)
# Before adding a module here, make sure it does not support type hints
# Per-module options for aea dir:
[mypy-aea.*]
ignore_missing_imports = True
[mypy-packages.open_aea.*]
ignore_errors=True
[mypy-packages.valory.connections.*]
ignore_errors=True
[mypy-pandas.*]
ignore_missing_imports = True
[mypy-packages.valory.contracts.*]
ignore_errors=True
[mypy-packages.valory.protocols.*]
ignore_errors=True
[mypy-packages.valory.skills.abstract_abci.*]
ignore_errors=True
[mypy-packages.valory.skills.abstract_round_abci.*]
ignore_errors=True
[mypy-packages.valory.skills.registration_abci.*]
ignore_errors=True
[mypy-requests]
ignore_missing_imports=True
[mypy-yaml]
ignore_missing_imports=True
[mypy-aea_test_autonomy.*]
ignore_missing_imports = True
[mypy-statsmodels.*]
ignore_missing_imports = True
[mypy-_pytest.*]
ignore_missing_imports = True
[mypy-aea_ledger_ethereum.*]
ignore_missing_imports=True
[mypy-ipfshttpclient.*]
ignore_missing_imports = True
[mypy-pytest]
ignore_missing_imports = True
[mypy-hypothesis.*]
ignore_missing_imports = True
[mypy-docker.*]
ignore_missing_imports = True
[mypy-certifi.*]
ignore_missing_imports = True
[mypy-aea_cli_ipfs.*]
ignore_missing_imports = True
[mypy-py_eth_sig_utils.*]
ignore_missing_imports = True
[mypy-openapi_core.*]
ignore_missing_imports=True
[mypy-openapi_spec_validator.*]
ignore_missing_imports=True
[mypy-click.*]
ignore_missing_imports=True
[mypy-autonomy.*]
ignore_missing_imports=True
[darglint]
docstring_style=sphinx
strictness=short
ignore_regex=async_act
ignore=DAR401
[pytest]
log_cli = 1
log_cli_level = DEBUG
log_cli_format = %(asctime)s [%(levelname)8s] %(message)s (%(filename)s:%(lineno)s)
log_cli_date_format=%Y-%m-%d %H:%M:%S
asyncio_mode=strict
markers =
integration: marks integration tests which require other network services
e2e: marks end-to-end agent tests
filterwarnings = ignore::DeprecationWarning:aea.*:
; some useful links:
; - https://janelia-flyem.github.io/licenses.html
; - https://dwheeler.com/essays/floss-license-slide.html
; Authorized and unauthorized licenses in LOWER CASE
[Licenses]
authorized_licenses:
; aliases for MIT License
MIT
MIT license
https://opensource.org/licenses/MIT
License :: OSI Approved :: MIT
; aliases for BSD License (and variants)
BSD
BSD license
new BSD
(new) BSD
new BDS license
simplified BSD
3-Clause BSD
BSD-3-Clause
BSD 3-Clause
BSD-2-Clause
BSD-like
BSD-2-Clause or Apache-2.0
BSD, Public Domain
; Apache
Apache Software
; aliases for Apache License version 2.0
Apache 2.0
Apache-2.0
Apache License 2.0
Apache License, Version 2.0
Apache License Version 2.0
Apache2
ASL 2
; some packages use 'Apache Software' as license string,
; which is ambiguous. However, 'Apache Software'
; will likely match with 'Apache 2.0'
Apache Software
BSD, Public Domain, Apache
http://www.apache.org/licenses/LICENSE-2.0
; PSF (BSD-style)
Python Software Foundation
PSF
; other permissive licenses
Historical Permission Notice and Disclaimer (HPND)
HPND
ISC
BSD or Apache License, Version 2.0
Modified BSD
Expat
Public Domain
unauthorized_licenses:
; aliases for MPL 2.0
MPL-2.0
MPL 2.0
Mozilla Public License 2.0 (MPL 2.0)
; Section 8 of https://www.mozilla.org/en-US/MPL/2.0/Revision-FAQ/
MPL 1.1
MPL-1.1
; http://www.gnu.org/licenses/license-list.en.html#apache2
GPLv2
GPLv2+
GNU General Public License v2 or later (GPLv2+)
; LGPL
LGPL
GNU Library or Lesser General Public License (LGPL)
; LGPLv2.1
LGPLv2.1
LGPLv2.1+
GNU Lesser General Public License v2 or later (LGPLv2+)
; LGPLv3
GNU Lesser General Public License v3 (LGPLv3)
LGPLv3
; GPL v3
GPL v3
GPLv3+
GNU General Public License v3 (GPLv3)
[Authorized Packages]
gym: >=0.15
;filelock is public domain
filelock: >=3.0.12
fetchai-ledger-api: >=0.0.1
chardet: >=3.0.4
certifi: >=2019.11.28
;TODO: the following are conflicting packages that need to be sorted
; sub-dep of open-aea-ledger-ethereum-hwi
hidapi: >=0.13.2
; shows in pip freeze but not referenced on code
paramiko: >=3.1.0
; sub-dep of docker-compose
websocket-client: >=0.59.0