2019-11-27 04:34:18 +08:00
|
|
|
# Reference: https://github.com/ethereum/ethereum-python-project-template/blob/master/tox.ini
|
2019-07-24 15:54:30 +08:00
|
|
|
|
2019-11-27 04:34:18 +08:00
|
|
|
# TODO: consider py36 and pypy3 support
|
2019-07-24 15:54:30 +08:00
|
|
|
[tox]
|
|
|
|
envlist =
|
|
|
|
py37-test
|
2019-08-28 23:39:33 +08:00
|
|
|
py37-interop
|
2019-07-24 15:54:30 +08:00
|
|
|
lint
|
2019-07-29 18:51:01 +08:00
|
|
|
docs
|
2019-08-03 05:38:03 +08:00
|
|
|
|
2019-08-03 13:29:21 +08:00
|
|
|
[isort]
|
2019-11-27 04:55:59 +08:00
|
|
|
combine_as_imports=False
|
2019-08-03 13:29:21 +08:00
|
|
|
force_sort_within_sections=True
|
|
|
|
include_trailing_comma=True
|
2019-11-27 04:55:59 +08:00
|
|
|
known_third_party=hypothesis,pytest,p2pclient,pexpect,factory
|
2018-01-25 08:00:28 +08:00
|
|
|
known_first_party=<MODULE_NAME>
|
2019-08-14 05:36:05 +08:00
|
|
|
line_length=88
|
2018-01-25 08:00:28 +08:00
|
|
|
multi_line_output=3
|
|
|
|
use_parentheses=True
|
2019-11-27 04:34:18 +08:00
|
|
|
force_grid_wrap=0
|
2019-08-11 16:47:54 +08:00
|
|
|
skip_glob=
|
|
|
|
*_pb2*.py
|
|
|
|
*.pyi
|
2019-08-03 13:29:21 +08:00
|
|
|
|
2018-01-25 08:00:28 +08:00
|
|
|
[flake8]
|
2019-11-27 04:34:18 +08:00
|
|
|
max-line-length = 100
|
|
|
|
exclude = venv*,.tox,docs,build,*_pb2*.py
|
|
|
|
ignore = E203, W503
|
|
|
|
max-complexity = 18
|
|
|
|
select = B,C,E,F,W,T4,B9
|
2018-01-25 08:00:28 +08:00
|
|
|
|
2019-07-24 15:54:30 +08:00
|
|
|
[testenv]
|
2018-01-25 08:00:28 +08:00
|
|
|
usedevelop=True
|
2019-07-24 15:54:30 +08:00
|
|
|
commands =
|
2019-11-27 04:34:18 +08:00
|
|
|
test: pytest {posargs:tests/}
|
2019-07-29 18:51:01 +08:00
|
|
|
docs: make build-docs
|
2019-07-24 15:54:30 +08:00
|
|
|
basepython =
|
2019-07-29 18:51:01 +08:00
|
|
|
docs: python
|
2019-07-24 15:54:30 +08:00
|
|
|
py37: python3.7
|
2019-11-27 04:34:18 +08:00
|
|
|
extras =
|
2018-02-08 03:14:11 +08:00
|
|
|
test
|
2019-07-29 18:51:01 +08:00
|
|
|
docs: doc
|
2019-11-27 04:34:18 +08:00
|
|
|
whitelist_externals = make
|
|
|
|
deps =
|
|
|
|
passenv = CI TRAVIS TRAVIS_*
|
2019-07-24 15:54:30 +08:00
|
|
|
|
|
|
|
[testenv:lint]
|
|
|
|
basepython = python3
|
2019-11-27 04:34:18 +08:00
|
|
|
extras = lint
|
2019-07-24 15:54:30 +08:00
|
|
|
commands =
|
2019-11-27 04:34:18 +08:00
|
|
|
mypy -p {toxinidir}/libp2p -p examples --config-file {toxinidir}/mypy.ini
|
|
|
|
flake8 {toxinidir}/libp2p {toxinidir}/tests tests_interop examples setup.py
|
2019-09-23 22:00:40 +08:00
|
|
|
black --check libp2p tests tests_interop examples setup.py
|
2019-11-27 04:34:18 +08:00
|
|
|
isort --recursive --check-only --diff {toxinidir}/libp2p {toxinidir}/tests tests_interop examples setup.py
|
2019-10-26 18:45:26 +08:00
|
|
|
docformatter --pre-summary-newline --check --recursive libp2p tests tests_interop examples setup.py
|
2019-09-23 22:00:40 +08:00
|
|
|
|
|
|
|
[testenv:py37-interop]
|
2019-09-24 11:30:52 +08:00
|
|
|
deps =
|
|
|
|
p2pclient
|
|
|
|
pexpect
|
2019-09-23 22:00:40 +08:00
|
|
|
passenv = CI TRAVIS TRAVIS_* GOPATH
|
|
|
|
extras = test
|
|
|
|
commands =
|
2019-09-24 11:30:52 +08:00
|
|
|
pytest tests_interop/
|
2019-09-23 22:00:40 +08:00
|
|
|
basepython =
|
|
|
|
py37: python3.7
|