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

Check types in travis #3024

Merged
merged 5 commits into from
Jun 18, 2019
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
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