Skip to content

Commit

Permalink
ci: mypy
Browse files Browse the repository at this point in the history
  • Loading branch information
Borda committed Feb 8, 2023
1 parent 1adb06c commit 656bdff
Showing 1 changed file with 18 additions and 2 deletions.
20 changes: 18 additions & 2 deletions .github/workflows/check-code.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,9 @@ jobs:

- name: Install dependencies
run: |
pip install -e '.[test]' --extra-index-url https://download.pytorch.org/whl/cpu/torch_stable.html
pip install mypy types-setuptools # don't use --upgrade to respect the version installed via setup.py
# don't use --upgrade to respect the version installed via setup.py
pip install -e '.[test]' mypy types-setuptools \
--extra-index-url https://download.pytorch.org/whl/cpu/torch_stable.html
pip list
- name: Pull re-usable 🤖 actions️
Expand All @@ -49,6 +50,9 @@ jobs:
with:
unfold: true

# see: https://github.com/python/mypy/issues/10600#issuecomment-857351152
- run: yes | mypy src --install-types || true

- name: Check typing
# mypy uses the config file found in the following order:
# 1. mypy.ini
Expand All @@ -60,6 +64,18 @@ jobs:
# https://mypy.readthedocs.io/en/stable/config_file.html
run: mypy

- name: suggest ignores
if: failure()
run: |
mypy --no-error-summary 2>&1 \
| tr ':' ' ' \
| awk '{print $1}' \
| sort \
| uniq \
| sed 's/\.py//g; s|src/||g; s|\/|\.|g' \
| xargs -I {} echo '"{}",' \
|| true
pre-commit:
runs-on: ubuntu-20.04
Expand Down

0 comments on commit 656bdff

Please sign in to comment.