diff --git a/.gitignore b/.gitignore index 5ca9148..9650884 100644 --- a/.gitignore +++ b/.gitignore @@ -1,11 +1,13 @@ *.pyc *.sw? *~ /.coverage /.coverage.* .eggs/ __pycache__ *.egg-info/ version.txt build/ dist/ +.mypy_cache/ +.tox/ 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..f14e196 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__ = extend_path(__path__, __name__) # type: Iterable[str] diff --git a/swh/mirror/__init__.py b/swh/mirror/__init__.py index 69e3be5..f14e196 100644 --- a/swh/mirror/__init__.py +++ b/swh/mirror/__init__.py @@ -1 +1,4 @@ -__path__ = __import__('pkgutil').extend_path(__path__, __name__) +from pkgutil import extend_path +from typing import Iterable + +__path__ = extend_path(__path__, __name__) # type: Iterable[str] diff --git a/swh/mirror/forge/py.typed b/swh/mirror/forge/py.typed new file mode 100644 index 0000000..1242d43 --- /dev/null +++ b/swh/mirror/forge/py.typed @@ -0,0 +1 @@ +# Marker file for PEP 561. diff --git a/tox.ini b/tox.ini new file mode 100644 index 0000000..1c3bb1b --- /dev/null +++ b/tox.ini @@ -0,0 +1,17 @@ +[tox] +envlist=flake8,mypy + +[testenv:flake8] +skip_install = true +deps = + flake8 +commands = + {envpython} -m flake8 + +[testenv:mypy] +skip_install = true +deps = + .[testing] + mypy +commands = + mypy swh