diff --git a/.travis.yml b/.travis.yml index 72a540edb3..c196b2e690 100644 --- a/.travis.yml +++ b/.travis.yml @@ -42,7 +42,7 @@ jobs: - stage: lint name: lint python: 3.6 - before_install: pip install flake8 isort>=5.0 nbstripout nbformat + before_install: pip install flake8 isort>=5.0 mypy nbstripout nbformat install: script: - make lint @@ -55,13 +55,6 @@ jobs: - pip install -r docs/requirements.txt - make docs - make doctest - - name: type_check - python: 3.6 - script: - - pip install mypy==0.812 - - pwd - - ls - - mypy pyro - name: perf python: 3.6 script: diff --git a/Makefile b/Makefile index 0d906e54e3..9500b5f833 100644 --- a/Makefile +++ b/Makefile @@ -21,6 +21,9 @@ lint: FORCE flake8 isort --check . python scripts/update_headers.py --check + mypy pyro + # mypy examples # FIXME + mypy scripts license: FORCE python scripts/update_headers.py diff --git a/examples/__init__.py b/examples/__init__.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/examples/contrib/__init__.py b/examples/contrib/__init__.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/examples/contrib/funsor/__init__.py b/examples/contrib/funsor/__init__.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/examples/cvae/__init__.py b/examples/cvae/__init__.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/examples/scanvi/__init__.py b/examples/scanvi/__init__.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/setup.cfg b/setup.cfg index 3dc45864e6..9785fe5387 100644 --- a/setup.cfg +++ b/setup.cfg @@ -35,35 +35,31 @@ column_limit = 120 python_version = 3.6 warn_return_any = True warn_unused_configs = True +warn_incomplete_stub = True +ignore_missing_imports = True # Per-module options: [mypy-pyro._version.*] ignore_errors = True -warn_incomplete_stub = True [mypy-pyro.contrib.*] ignore_errors = True -warn_incomplete_stub = True [mypy-pyro.distributions.*] ignore_errors = True -warn_incomplete_stub = True warn_unused_ignores = True [mypy-pyro.generic.*] ignore_errors = True -warn_incomplete_stub = True warn_unused_ignores = True [mypy-pyro.infer.*] ignore_errors = True -warn_incomplete_stub = True warn_unused_ignores = True [mypy-pyro.nn.*] ignore_errors = True -warn_incomplete_stub = True warn_unused_ignores = True [mypy-pyro.ops.*] @@ -71,7 +67,6 @@ ignore_errors = True warn_unused_ignores = True [mypy-pyro.optm.*] -warn_incomplete_stub = True warn_unused_ignores = True [mypy-pyro.params.*] @@ -83,5 +78,4 @@ ignore_errors = True [mypy-pyro.util.*] ignore_errors = True -warn_incomplete_stub = True warn_unused_ignores = True diff --git a/setup.py b/setup.py index 0a6c2aef1d..9602f041ca 100644 --- a/setup.py +++ b/setup.py @@ -104,6 +104,7 @@ 'dev': EXTRAS_REQUIRE + [ 'flake8', 'isort>=5.0', + 'mypy>=0.812', 'nbformat', 'nbsphinx>=0.3.2', 'nbstripout',