diff --git a/.gitignore b/.gitignore index d9bc97cf..1819bc1c 100644 --- a/.gitignore +++ b/.gitignore @@ -12,6 +12,7 @@ _mailinglist .idea __pycache__ .pytest_cache/ +.mypy_cache/* .tox/ .venv venv/ diff --git a/.travis.yml b/.travis.yml index 2e3ad1ef..d501f1be 100644 --- a/.travis.yml +++ b/.travis.yml @@ -18,6 +18,10 @@ matrix: env: TOXENV=py36 - python: "3.6" env: TOXENV=docs + - python: "3.6" + env: TOXENV=bandit + - python: "3.6" + env: TOXENV=mypy before-install: - sudo apt-get -qq update - sudo apt-get install -y libavahi-compat-libdnssd-dev diff --git a/tox.ini b/tox.ini index d14d66d2..eda6d20e 100644 --- a/tox.ini +++ b/tox.ini @@ -1,5 +1,5 @@ [tox] -envlist = py35, py36, docs, lint, pylint +envlist = py35, py36, docs, lint, pylint, mypy, bandit skip_missing_interpreters = True [testenv] @@ -54,3 +54,20 @@ commands = flake8 pyhap tests --select=D10,D205,D4,E501 pylint pyhap --disable=all --enable=missing-docstring,empty-docstring # pydocstyle pyhap tests + + +[testenv:mypy] +basepython = {env:PYTHON3_PATH:python3} +deps = + -r{toxinidir}/requirements_all.txt + mypy +commands = + mypy --ignore-missing-imports pyhap + + +[testenv:bandit] +basepython = {env:PYTHON3_PATH:python3} +deps = + bandit +commands = + bandit -r pyhap