Skip to content
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
3 changes: 2 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,11 +51,12 @@ jobs:
- stage: Lint check
python: "3.7"
before_install: # Nothing to do
install: pip install flake8 "black==19.10b0" "isort==4.3.21"
install: pip install flake8 "black==19.10b0" "isort==4.3.21" "mypy==0.782"
script:
- flake8 .
- black --check .
- isort -rc -c .
- mypy --config-file mypy.ini
after_success: # Nothing to do

# GitHub Pages Deployment: https://docs.travis-ci.com/user/deployment/pages/
Expand Down
10 changes: 9 additions & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ git clone https://github.com/pytorch/ignite.git
cd ignite
python setup.py develop
pip install -r requirements-dev.txt
pip install flake8 "black==19.10b0" "isort==4.3.21"
pip install flake8 "black==19.10b0" "isort==4.3.21" "mypy==0.782"
```

### Code development
Expand Down Expand Up @@ -126,6 +126,14 @@ CI_PYTHON_VERSION=<your python version, e.g 3.7> sh tests/run_cpu_tests.sh
# CI_PYTHON_VERSION=3.7 sh tests/run_cpu_tests.sh
```

#### Run Mypy checks:
To run mypy to check the optional static type:
```bash
mypy --config-file mypy.ini
```

To change any config for specif folder, please see the file mypy.ini

#### Send a PR

If everything is OK, please send a Pull Request to https://github.com/pytorch/ignite
Expand Down
32 changes: 32 additions & 0 deletions mypy.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
[mypy]
files = ignite
pretty = True
show_error_codes = True

[mypy-ignite.base.*]

ignore_errors = True

[mypy-ignite.contrib.*]

ignore_errors = True

[mypy-ignite.handlers.*]

ignore_errors = True

[mypy-ignite.engine.*]

ignore_errors = True

[mypy-ignite.metrics.*]

ignore_errors = True

[mypy-ignite.distributed.*]

ignore_errors = True

[mypy-ignite.utils.*]

ignore_errors = True