merge template updates and refill vars

This commit is contained in:
pacrob
2024-02-19 14:44:45 -07:00
30 changed files with 773 additions and 475 deletions

111
tox.ini
View File

@ -1,66 +1,67 @@
# Reference: https://github.com/ethereum/ethereum-python-project-template/blob/master/tox.ini
# TODO: consider pypy3 support
[tox]
envlist =
py{36,37}-test
py37-interop
lint
envlist=
py{38,39,310,311,312}-core
py{38,39,310,311,312}-lint
py{38,39,310,311,312}-wheel
windows-wheel
docs
[isort]
combine_as_imports=False
force_sort_within_sections=True
include_trailing_comma=True
known_third_party=anyio,factory,lru,p2pclient,pytest,noise
known_first_party=libp2p
line_length=88
multi_line_output=3
use_parentheses=True
force_grid_wrap=0
skip_glob=
*_pb2*.py
*.pyi
[flake8]
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
exclude=venv*,.tox,docs,build,*_pb2*.py
extend-ignore=E203
max-line-length=88
per-file-ignores=__init__.py:F401
[testenv]
usedevelop=True
commands =
test: pytest {posargs:tests/}
docs: make build-docs
basepython =
commands=
core: pytest {posargs:tests/}
docs: make check-docs-ci
basepython=
docs: python
py37: python3.7
py36: python3.6
extras =
windows-wheel: python
py38: python3.8
py39: python3.9
py310: python3.10
py311: python3.11
py312: python3.12
extras=
test
docs: doc
whitelist_externals = make
deps =
passenv = CI TRAVIS TRAVIS_*
docs
allowlist_externals=make,pre-commit
[testenv:lint]
basepython = python3
extras = lint
commands =
mypy -p {toxinidir}/libp2p -p examples --config-file {toxinidir}/mypy.ini
flake8 {toxinidir}/libp2p {toxinidir}/tests tests_interop examples setup.py
black --check libp2p tests tests_interop examples setup.py
isort --recursive --check-only --diff {toxinidir}/libp2p {toxinidir}/tests tests_interop examples setup.py
docformatter --pre-summary-newline --check --recursive libp2p tests tests_interop examples setup.py
[testenv:py{38,39,310,311,312}-lint]
deps=pre-commit
commands=
pre-commit install
pre-commit run --all-files --show-diff-on-failure
[testenv:py37-interop]
deps =
p2pclient
passenv = CI TRAVIS TRAVIS_* GOPATH
extras = test
commands =
pytest tests_interop/
basepython =
py37: python3.7
[testenv:py{38,39,310,311,312}-wheel]
deps=
wheel
build[virtualenv]
allowlist_externals=
/bin/rm
/bin/bash
commands=
python -m pip install --upgrade pip
/bin/rm -rf build dist
python -m build
/bin/bash -c 'python -m pip install --upgrade "$(ls dist/libp2p-*-py3-none-any.whl)" --progress-bar off'
python -c "import libp2p"
skip_install=true
[testenv:windows-wheel]
deps=
wheel
build[virtualenv]
allowlist_externals=
bash.exe
commands=
python --version
python -m pip install --upgrade pip
bash.exe -c "rm -rf build dist"
python -m build
bash.exe -c 'python -m pip install --upgrade "$(ls dist/libp2p-*-py3-none-any.whl)" --progress-bar off'
python -c "import libp2p"
skip_install=true