-
Notifications
You must be signed in to change notification settings - Fork 19
/
tox.ini
497 lines (416 loc) · 11.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
490
491
492
493
494
495
496
497
; 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-dependencies, flake8, mypy, pylint, darglint, check-generate-all-protocols, check-abciapp-specs, check-abci-docstrings, check-handlers, py{3.7,3.8,3.9,3.10}-{win,linux,darwin}
; when running locally we don't want to fail for no good reason
skip_missing_interpreters = true
isolated_build = True
[deps-tests]
deps =
tomte[tests]==0.2.12
[deps-packages]
deps =
{[deps-tests]deps}
open-autonomy==0.12.1.post1
requests==2.28.2
py-multibase==1.0.3
py-multicodec==0.2.1
py-eth-sig-utils
grpcio==1.53.0
asn1crypto<1.5.0,>=1.4.0
open-aea-ledger-ethereum==1.39.0
open-aea-ledger-cosmos==1.39.0
protobuf<=3.20.1,>=3.19
hypothesis==6.21.6
open-aea-test-autonomy==0.12.1.post1
open-aea-web3==6.0.1
ipfshttpclient==0.8.0a2
open-aea-cli-ipfs==1.39.0
aiohttp<3.8,>=3.7.4
certifi
multidict
ecdsa>=0.15
eth_typing
hexbytes==0.3.1
packaging
py-ecc==6.0.0
pytz==2022.2.1
typing_extensions>=3.10.0.2
websocket_client<1,>=0.32.0
toml==0.10.2
pytest-asyncio
eth-utils==2.2.0
eth-abi==4.0.0
pycryptodome==3.18.0
pytest==7.2.1
urllib3==1.26.16
[testenv]
basepython = python3
whitelist_externals = /bin/sh
deps = {[deps-packages]deps}
passenv = *
extras = all
setenv =
PYTHONHASHSEED=0
PYTHONPATH={env:PWD:%CD%}
PACKAGES_PATHS = packages/valory
SKILLS_PATHS = {env:PACKAGES_PATHS}/skills
SERVICE_SPECIFIC_PACKAGES = {env:SKILLS_PATHS}/market_manager_abci {env:SKILLS_PATHS}/decision_maker_abci {env:SKILLS_PATHS}/trader_abci {env:SKILLS_PATHS}/tx_settlement_multiplexer_abci
[testenv:bandit]
skipsdist = True
skip_install = True
deps = tomte[bandit]==0.2.12
commands =
bandit -s B101 -r {env:SERVICE_SPECIFIC_PACKAGES}
bandit -s B101 -r scripts
[testenv:black]
skipsdist = True
skip_install = True
deps = tomte[black]==0.2.12
commands = black {env:SERVICE_SPECIFIC_PACKAGES} scripts
[testenv:black-check]
skipsdist = True
skip_install = True
deps = tomte[black]==0.2.12
commands = black --check {env:SERVICE_SPECIFIC_PACKAGES} scripts
[testenv:isort]
skipsdist = True
skip_install = True
deps = tomte[isort]==0.2.12
commands =
isort {env:SERVICE_SPECIFIC_PACKAGES} --gitignore
isort scripts/
[testenv:isort-check]
skipsdist = True
skip_install = True
deps = tomte[isort]==0.2.12
commands = isort --check-only --gitignore {env:SERVICE_SPECIFIC_PACKAGES} scripts
[testenv:check-hash]
skipsdist = True
usedevelop = True
deps = open-autonomy[all]==0.12.1.post1
commands =
autonomy init --reset --author ci --remote --ipfs --ipfs-node "/dns/registry.autonolas.tech/tcp/443/https"
autonomy packages sync
autonomy packages lock --check
[testenv:check-packages]
skipsdist = True
usedevelop = True
deps = {[deps-packages]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:check-dependencies]
skipsdist = True
usedevelop = True
commands =
autonomy packages sync
{toxinidir}/scripts/check_dependencies.py
[testenv:flake8]
skipsdist = True
skip_install = True
deps = tomte[flake8]==0.2.12
commands =
flake8 {env:SERVICE_SPECIFIC_PACKAGES}
flake8 scripts
[testenv:mypy]
skipsdist = True
skip_install = True
deps = tomte[mypy]==0.2.12
commands =
mypy {env:SERVICE_SPECIFIC_PACKAGES} --disallow-untyped-defs --config-file tox.ini
mypy scripts --disallow-untyped-defs --config-file tox.ini
[testenv:pylint]
whitelist_externals = /bin/sh
skipsdist = True
deps =
{[deps-packages]deps}
tomte[pylint]==0.2.12
commands = pylint --ignore-patterns=".*_pb2.py" --ignore-paths="^packages/valory/.*$" --disable=C0103,R0801,R0912,C0301,C0201,C0204,C0209,W1203,C0302,R1735,R1729,W0511 {env:SERVICE_SPECIFIC_PACKAGES} scripts
[testenv:safety]
skipsdist = True
skip_install = True
deps = tomte[safety]==0.2.12
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.12
commands = darglint scripts {env:SERVICE_SPECIFIC_PACKAGES}/*
[testenv:check-generate-all-protocols]
skipsdist = True
usedevelop = True
deps =
{[deps-packages]deps}
tomte[isort]==0.2.12
tomte[black]==0.2.12
commands = autonomy generate-all-protocols --check-clean
[testenv:spell-check]
whitelist_externals = mdspell
skipsdist = True
usedevelop = True
deps = tomte[cli]==0.2.12
commands = tomte check-spelling
[testenv:abci-docstrings]
skipsdist = True
usedevelop = True
commands = autonomy analyse docstrings --update
[testenv:check-abci-docstrings]
skipsdist = True
usedevelop = True
commands = autonomy analyse docstrings
[testenv:check-abciapp-specs]
skipsdist = True
usedevelop = True
commands =
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-handlers]
skipsdist = True
usedevelop = True
commands = autonomy analyse handlers -h abci -h http -h contract_api -h ledger_api -h signing -i abstract_abci -i contract_subscription
[testenv:check-doc-hashes]
skipsdist = True
skip_install = True
commands =
aea init --reset --author ci --remote --ipfs --ipfs-node "/dns/registry.autonolas.tech/tcp/443/https"
aea packages sync
{toxinidir}/scripts/check_doc_ipfs_hashes.py
[testenv:fix-doc-hashes]
skipsdist = True
skip_install = True
commands = {toxinidir}/scripts/check_doc_ipfs_hashes.py --fix
[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
[testenv:analyse-service]
skipsdist = True
usedevelop = True
commands = autonomy analyse service --public-id valory/trader --skip-warnings
[flake8]
paths=packages
exclude=.md,
*_pb2.py,
*_pb2_grpc.py,
custom_types.py,
max-line-length = 88
select = B,C,D,E,F,I,W,
ignore = E203,E501,W503,D202,B014,D400,D401,DAR
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=
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-toml.*]
ignore_missing_imports = True
[mypy-packages.valory.connections.*]
ignore_errors=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-pandas.*]
ignore_missing_imports = True
[mypy-aea_cli_ipfs.*]
ignore_missing_imports = True
[mypy-mech_client.*]
ignore_missing_imports = True
[mypy-py_eth_sig_utils.*]
ignore_missing_imports = True
[mypy-web3.*]
ignore_missing_imports = True
[mypy-open-aea-web3.*]
ignore_missing_imports = True
[mypy-multibase.*]
ignore_missing_imports = True
[mypy-multicodec.*]
ignore_missing_imports = True
[mypy-openai.*]
ignore_missing_imports = True
[mypy-hexbytes.*]
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.1
; shows in pip freeze but not referenced on code
paramiko: >=3.1.0
; sub-dep of docker-compose
websocket-client: >=0.59.0
; sub-dep of openai
tqdm: >=4.56.0
; sub-dep of cosmos
blspy: >=1.0.16
; sub-dep of cosmos
hypothesis: ==6.21.6
; we don't modif