- Put extras_require to setup.py
- Add mypy
This commit is contained in:
mhchia 2019-07-24 15:54:30 +08:00
parent d6c19e71a6
commit 9497c3180f
No known key found for this signature in database
GPG Key ID: 389EFBEA1362589A
3 changed files with 54 additions and 0 deletions

12
mypy.ini Normal file
View File

@ -0,0 +1,12 @@
[mypy]
warn_unused_ignores = True
ignore_missing_imports = True
strict_optional = False
check_untyped_defs = True
disallow_incomplete_defs = True
disallow_untyped_defs = True
disallow_any_generics = True
disallow_untyped_calls = True
warn_redundant_casts = True
warn_unused_configs = True
strict_equality = True

View File

@ -7,6 +7,26 @@ classifiers = [
]
# pylint: disable=invalid-name
extras_require = {
"test": [
"codecov",
"pytest",
"pytest-cov",
"pytest-asyncio",
],
"lint": [
"pylint",
"mypy",
],
"dev": [
"tox",
],
}
extras_require["dev"] = extras_require["test"] + extras_require["lint"] + extras_require["dev"]
setuptools.setup(
name="libp2p",
description="libp2p implementation written in python",
@ -26,6 +46,7 @@ setuptools.setup(
"lru-dict>=1.1.6",
"aio_timers>=0.0.1,<0.1.0",
],
extras_require=extras_require,
packages=setuptools.find_packages(exclude=["tests", "tests.*"]),
zip_safe=False,
)

21
tox.ini Normal file
View File

@ -0,0 +1,21 @@
# Reference: https://github.com/ethereum/py_ecc/blob/d0da74402210ea1503ef83b3c489d5b5eba7f7bf/tox.ini
[tox]
envlist =
py37-test
lint
[testenv]
deps =
extras = test
commands =
pytest --cov=./libp2p tests/
basepython =
py37: python3.7
[testenv:lint]
basepython = python3
extras = dev
commands =
pylint --rcfile={toxinidir}/.pylintrc libp2p tests
mypy -p p2pclient --config-file {toxinidir}/mypy.ini