Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incorporate mypy into lint stage #2858

Merged
merged 2 commits into from
Jun 4, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 1 addition & 8 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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:
Expand Down
3 changes: 3 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Empty file added examples/__init__.py
Empty file.
Empty file added examples/contrib/__init__.py
Empty file.
Empty file.
Empty file added examples/cvae/__init__.py
Empty file.
Empty file added examples/scanvi/__init__.py
Empty file.
10 changes: 2 additions & 8 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -35,43 +35,38 @@ 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.*]
ignore_errors = True
warn_unused_ignores = True

[mypy-pyro.optm.*]
warn_incomplete_stub = True
warn_unused_ignores = True

[mypy-pyro.params.*]
Expand All @@ -83,5 +78,4 @@ ignore_errors = True

[mypy-pyro.util.*]
ignore_errors = True
warn_incomplete_stub = True
warn_unused_ignores = True
1 change: 1 addition & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@
'dev': EXTRAS_REQUIRE + [
'flake8',
'isort>=5.0',
'mypy>=0.812',
'nbformat',
'nbsphinx>=0.3.2',
'nbstripout',
Expand Down