Skip to content

CI: run mypy in full env #4929

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 12 commits into from
Feb 22, 2021
Merged
Show file tree
Hide file tree
Changes from 9 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
45 changes: 45 additions & 0 deletions .github/workflows/ci-additional.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,51 @@ jobs:
run: |
python -m pytest --doctest-modules xarray --ignore xarray/tests

typing:
name: Type checking (mypy)
runs-on: "ubuntu-latest"
needs: detect-ci-trigger
if: false && needs.detect-ci-trigger.outputs.triggered == 'false'
defaults:
run:
shell: bash -l {0}

steps:
- name: Cancel previous runs
uses: styfle/[email protected]
with:
access_token: ${{ github.token }}
- uses: actions/checkout@v2
with:
fetch-depth: 0 # Fetch all history for all branches and tags.
- uses: conda-incubator/setup-miniconda@v2
with:
channels: conda-forge
channel-priority: strict
mamba-version: "*"
activate-environment: xarray-tests
auto-update-conda: false
python-version: "3.8"

- name: Install conda dependencies
run: |
mamba env update -f ci/requirements/environment.yml
- name: Install mypy
run: |
# version must correspond to the one in .pre-commit-config.yaml
mamba install mypy=0.812
- name: Install xarray
run: |
python -m pip install --no-deps -e .
- name: Version info
run: |
conda info -a
conda list
python xarray/util/print_versions.py
- name: Run mypy
run: |
python -m mypy xarray

min-version-policy:
name: Minimum Version Policy
runs-on: "ubuntu-latest"
Expand Down
1 change: 1 addition & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ repos:
# - id: velin
# args: ["--write", "--compact"]
- repo: https://github.com/pre-commit/mirrors-mypy
# version must correstpond to the one in .github/workflows/ci-additional.yaml
rev: v0.812
hooks:
- id: mypy
Expand Down