diff --git a/mypy.ini b/mypy.ini new file mode 100644 index 0000000..37a15a5 --- /dev/null +++ b/mypy.ini @@ -0,0 +1,3 @@ +[mypy] +namespace_packages = True +warn_unused_ignores = True diff --git a/swh/__init__.py b/swh/__init__.py index 69e3be5..e780381 100644 --- a/swh/__init__.py +++ b/swh/__init__.py @@ -1 +1,4 @@ -__path__ = __import__('pkgutil').extend_path(__path__, __name__) +from pkgutil import extend_path +from typing import Iterable + +__path__: Iterable[str] = extend_path(__path__, __name__) diff --git a/tox.ini b/tox.ini index c12e4f0..7c99df6 100644 --- a/tox.ini +++ b/tox.ini @@ -1,24 +1,32 @@ [tox] -envlist=flake8,py3 +envlist=flake8,mypy,py3 [testenv:py3] deps = pytest-cov commands = pytest --cov=swh --cov-branch {posargs} [testenv:flake8] skip_install = true deps = flake8 commands = {envpython} -m flake8 [testenv:flake8-phab] skip_install = true deps = flake8 git+https://framagit.org/douardda/flake8-phabricator-formatter.git commands = {envpython} -m flake8 --format=phabricator --output-file=.phabricator-lint + +[testenv:mypy] +extras = + testing +deps = + mypy +commands = + mypy swh