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
44 changes: 44 additions & 0 deletions .github/workflows/ci-additional.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,50 @@ 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: |
mamba install --file ci/requirements/mypy_only
- 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 correspond to the one in .github/workflows/ci-additional.yaml
rev: v0.812
hooks:
- id: mypy
Expand Down
3 changes: 3 additions & 0 deletions ci/requirements/mypy_only
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# used for the "Type checking (mypy)" CI run
# version must correspond to the one in .pre-commit-config.yaml
mypy=0.812