Skip to content

20200602 type hints part1 #477

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

Merged
merged 3 commits into from
Jun 3, 2020
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
11 changes: 11 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -110,3 +110,14 @@ temp/
.idea/

*~

# Remove .pyre temporary config files
.pyre
.pyre_configuration

# temporary editor files that should not be in git
.orig
.bak
.swp
*~
.DS_Store
1 change: 1 addition & 0 deletions docs/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,4 @@ sphinxcontrib-htmlhelp==1.0.2
sphinxcontrib-jsmath==1.0.1
sphinxcontrib-qthelp==1.0.2
sphinxcontrib-serializinghtml==1.1.3
sphinx-autodoc-typehints>=1.10.3
47 changes: 44 additions & 3 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,16 @@ ignore =
N812
# suppress flake8-mypy failures occuring when MYPYPATH=${src_dir}/monai/monai
T499
# --- Temporary disabling to allow smaller PRs
# Subsequent fixes necessary to make this tool pass are not yet
# merged into the master branch, but requested as separate
# commits. Can not enable until all outstanding typehint
# PR's are approved
T484
# Unused imports may be used later, disable warning while we
# separate many PR's
F401
# ^^^^^^^^^ Temporary disabling to allow smaller PRs
per-file-ignores = __init__.py: F401
exclude = *.pyi,.git,monai/_version.py,versioneer.py

Expand All @@ -48,11 +58,27 @@ tag_prefix =
parentdir_prefix =

[mypy]
# --- Temporary disabling to allow smaller PRs
# Subsequent fixes necessary to make this tool pass are not yet
# merged into the master branch, but requested as separate
# commits. Can not enable until all outstanding typehint
# PR's are approved
ignore_errors = True ## Temporarily disable all mypy warnings
# ^^^^^^ Temporary disabling to allow smaller PRs


# do not follow imports (except for ones found in typeshed)
follow_imports=normal

# suppress errors about unsatisfied imports
ignore_missing_imports=False
# The pytorch-ignite package is not type hinted and generates
# hundreds of failures that are not the priority to address
# at the monment. Eventually ignore_missing_imports=False
# should be used add consistent typing information to
# those parts of the MONAI package that depend on ignite.
ignore_missing_imports=True
# Temporarily ignore all site packages too
# --no_site_packages=True

# allow returning Any as a consequence of the options above
warn_return_any=True
Expand All @@ -63,10 +89,25 @@ warn_no_return=True
# lint-style cleanliness for typing needs to be disabled; returns more errors
# than the full run.
warn_redundant_casts=True
warn_unused_ignores=True
# NOTE: All relative paths are relative to the location of this file.
warn_unused_ignores=False

[mypy-torch.*]
# --- Temporary disabling to allow smaller PRs
# Subsequent fixes necessary to make this tool pass are not yet
# merged into the master branch, but requested as separate
# commits. Can not enable until all outstanding typehint
# PR's are approved
ignore_errors = True ## Temporarily disable all mypy warnings
# ^^^^^^ Temporary disabling to allow smaller PRs
follow_imports = skip
follow_imports_for_stubs = True

[mypy-monai._version]
# Always ignore any type issues in teh monai/._version file
ignore_errors = True

[pytype]
# NOTE: All relative paths are relative to the location of this file.
# Space-separated list of files or directories to exclude.
exclude = **/*_test.py **/test_*.py
# Space-separated list of files or directories to process.
Expand Down