Skip to content

Commit

Permalink
Add Github action to run mypy
Browse files Browse the repository at this point in the history
Signed-off-by: Chad Dombrova <[email protected]>
  • Loading branch information
chadrik committed Aug 5, 2024
1 parent 6220a10 commit 3e61ca7
Show file tree
Hide file tree
Showing 3 changed files with 360 additions and 0 deletions.
48 changes: 48 additions & 0 deletions .github/workflows/mypy.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: mypy
on:
pull_request:
paths:
- 'src/rez/**.py'
- 'src/rezplugins/**.py'
- 'pyproject.toml'
- '!src/rez/utils/_version.py'
- '!src/rez/data/**'
- '!src/rez/vendor/**'
- '!src/rez/backport/**'
push:
paths:
- 'src/rez/**.py'
- 'src/rezplugins/**.py'
- 'pyproject.toml'
- '!src/rez/utils/_version.py'
- '!src/rez/data/**'
- '!src/rez/vendor/**'
- '!src/rez/backport/**'

permissions:
contents: read

jobs:
mypy:
name: Run mypy static type analysis
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7

- name: Set up Python
uses: actions/setup-python@82c7e631bb3cdc910f68e0081d67478d79c6982d # v5.1.0
with:
python-version: "3.10"

- name: Install Dependencies
run: |
pip install mypy==1.11.1 mypy_baseline==0.7.1 types-setuptools
- name: Run mypy
# To update the baseline run:
# mypy | mypy-baseline sync --ignore-categories=note
# then commit mypy-baseline.txt
run: >-
mypy | mypy-baseline filter --ignore-categories=note --allow-unsynced
Loading

0 comments on commit 3e61ca7

Please sign in to comment.