diff --git a/.gitignore b/.gitignore index da98680..f9ef9a5 100644 --- a/.gitignore +++ b/.gitignore @@ -1,12 +1,13 @@ *.egg-info/ *.pyc *.sw? *~ .coverage .eggs/ .mypy_cache .tox __pycache__ build/ dist/ version.txt +.mypy_cache/ diff --git a/mypy.ini b/mypy.ini new file mode 100644 index 0000000..46f8db8 --- /dev/null +++ b/mypy.ini @@ -0,0 +1,15 @@ +[mypy] +namespace_packages = True +warn_unused_ignores = True + + +# 3rd party libraries without stubs (yet) + +[mypy-pkg_resources.*] +ignore_missing_imports = True + +[mypy-pytest.*] +ignore_missing_imports = True + +# [mypy-add_your_lib_here.*] +# ignore_missing_imports = True diff --git a/swh/foo/py.typed b/swh/foo/py.typed new file mode 100644 index 0000000..1242d43 --- /dev/null +++ b/swh/foo/py.typed @@ -0,0 +1 @@ +# Marker file for PEP 561. diff --git a/tox.ini b/tox.ini index 335f4ed..2b5b085 100644 --- a/tox.ini +++ b/tox.ini @@ -1,23 +1,31 @@ [tox] envlist=check-manifest,flake8,py3 [testenv:py3] deps = .[testing] pytest-cov commands = pytest --cov=swh --cov-branch {posargs} [testenv:flake8] skip_install = true deps = flake8 commands = {envpython} -m flake8 [testenv:check-manifest] skip_install = true deps = check-manifest commands = {envpython} -m check_manifest {toxinidir} + +[testenv:mypy] +skip_install = true +deps = + .[testing] + mypy +commands = + mypy swh