-
Notifications
You must be signed in to change notification settings - Fork 21
/
tox.ini
456 lines (392 loc) · 10.7 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
; 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, abci-docstrings, check-abciapp-specs, py{3.8,3.9,3.10,3.11}-{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.15
[deps-packages]
deps =
{[deps-tests]deps}
open-autonomy==0.14.6
toml==0.10.2
typing_extensions>=3.10.0.2
[testenv]
basepython = python3
whitelist_externals = /bin/sh
passenv = *
extras = all
deps = {[deps-packages]deps}
setenv =
PYTHONHASHSEED=0
PACKAGES_PATHS = packages
SERVICE_SPECIFIC_PACKAGES = {env:PACKAGES_PATHS}
commands =
autonomy init --reset --author ci --remote --ipfs --ipfs-node "/dns/registry.autonolas.tech/tcp/443/https"
autonomy packages sync
pytest -rfE --doctest-modules tests/ --cov=packages --cov-report=xml --cov-report=term --cov-report=term-missing --cov-config=.coveragerc {posargs}
[testenv:py3.8-linux]
basepython = python3.8
platform=^linux$
usedevelop = True
deps = {[testenv]deps}
setenv = {[testenv]setenv}
[testenv:py3.9-linux]
basepython = python3.9
platform=^linux$
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.15
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.15
commands = black {env:SERVICE_SPECIFIC_PACKAGES} scripts
[testenv:black-check]
skipsdist = True
skip_install = True
deps =
tomte[black]==0.2.15
commands = black --check {env:SERVICE_SPECIFIC_PACKAGES} scripts
[testenv:isort]
skipsdist = True
skip_install = True
deps =
tomte[isort]==0.2.15
commands =
isort {env:SERVICE_SPECIFIC_PACKAGES} --gitignore
isort scripts/
[testenv:isort-check]
skipsdist = True
skip_install = True
deps =
tomte[isort]==0.2.15
commands = isort --check-only --gitignore {env:SERVICE_SPECIFIC_PACKAGES} 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: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.15
commands =
flake8 {env:SERVICE_SPECIFIC_PACKAGES}
flake8 scripts
[testenv:mypy]
skipsdist = True
skip_install = True
deps =
{[testenv]deps}
tomte[mypy]==0.2.15
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.15
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.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 scripts {env:SERVICE_SPECIFIC_PACKAGES}/*
[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:abci-docstrings]
skipsdist = True
usedevelop = True
commands = autonomy analyse docstrings --update
[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: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:spell-check]
whitelist_externals = mdspell
skipsdist = True
usedevelop = True
deps =
tomte[cli]==0.2.15
commands = tomte check-spelling
[testenv:liccheck]
skipsdist = True
usedevelop = True
deps =
tomte[liccheck,cli]==0.2.15
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,
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)
[mypy-requests]
ignore_missing_imports=True
[mypy-yaml]
ignore_missing_imports=True
[mypy-toml]
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
; aliases for MPL 2.0
MPL-2.0
MPL 2.0
Mozilla Public License 2.0 (MPL 2.0)
unauthorized_licenses:
; 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