Skip to content

Commit

Permalink
Check types in travis (#3024)
Browse files Browse the repository at this point in the history
* lint mypy typing

* dot

* revert autoformat

* allow failures for typing
  • Loading branch information
max-sixty authored and shoyer committed Jun 18, 2019
1 parent c2a2a6e commit 4c758e6
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 3 deletions.
12 changes: 9 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ matrix:
- env: CONDA_ENV=py36-zarr-dev
- env: CONDA_ENV=docs
- env: CONDA_ENV=lint
- env: CONDA_ENV=typing
- env: CONDA_ENV=py36-hypothesis

allow_failures:
Expand All @@ -30,6 +31,7 @@ matrix:
- EXTRA_FLAGS="--run-flaky --run-network-tests"
- env: CONDA_ENV=py36-pandas-dev
- env: CONDA_ENV=py36-zarr-dev
- env: CONDA_ENV=typing

before_install:
- wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh -O miniconda.sh;
Expand All @@ -40,9 +42,10 @@ before_install:
- conda info -a

install:
- if [[ "$CONDA_ENV" == "docs" ]]; then
- |
if [[ "$CONDA_ENV" == "docs" ]]; then
conda env create -n test_env --file doc/environment.yml;
elif [[ "$CONDA_ENV" == "lint" ]]; then
elif [[ "$CONDA_ENV" == "lint" ]] || [[ "$CONDA_ENV" == "typing" ]] ; then
conda env create -n test_env --file ci/requirements-py37.yml;
else
conda env create -n test_env --file ci/requirements-$CONDA_ENV.yml;
Expand All @@ -56,11 +59,14 @@ script:
- which python
- python --version
- python -OO -c "import xarray"
- if [[ "$CONDA_ENV" == "docs" ]]; then
- |
if [[ "$CONDA_ENV" == "docs" ]]; then
cd doc;
sphinx-build -n -j auto -b html -d _build/doctrees . _build/html;
elif [[ "$CONDA_ENV" == "lint" ]]; then
flake8 ;
elif [[ "$CONDA_ENV" == "typing" ]]; then
mypy . ;
elif [[ "$CONDA_ENV" == "py36-hypothesis" ]]; then
pytest properties ;
else
Expand Down
8 changes: 8 additions & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ known_first_party=xarray
multi_line_output=4

# Most of the numerical computing stack doesn't have type annotations yet.
[mypy-affine.*]
ignore_missing_imports = True
[mypy-bottleneck.*]
ignore_missing_imports = True
[mypy-cdms2.*]
Expand Down Expand Up @@ -85,6 +87,12 @@ ignore_missing_imports = True
[mypy-zarr.*]
ignore_missing_imports = True

# setuptools is not typed
[mypy-setup]
ignore_errors = True
# versioneer code
[mypy-versioneer.*]
ignore_errors = True
# written by versioneer
[mypy-xarray._version]
ignore_errors = True
Expand Down

0 comments on commit 4c758e6

Please sign in to comment.