Skip to content

Commit 4f2ff26

Browse files
sararobcopybara-github
authored andcommitted
chore: add GitHub Actions check to run mypy
PiperOrigin-RevId: 737701291
1 parent 7f1cc22 commit 4f2ff26

File tree

2 files changed

+37
-0
lines changed

2 files changed

+37
-0
lines changed

.github/workflows/mypy.yml

+32
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
# This workflow runs mypy for static type checking.
2+
# See https://mypy.readthedocs.io/en/stable/index.html for more information.
3+
#
4+
# You can adjust the behavior by modifying this file.
5+
name: Run mypy
6+
7+
on:
8+
pull_request:
9+
branches:
10+
- main
11+
12+
jobs:
13+
mypy:
14+
runs-on: ubuntu-latest
15+
16+
steps:
17+
- name: Checkout code
18+
uses: actions/checkout@v4
19+
20+
- name: Set up Python
21+
uses: actions/setup-python@v5
22+
with:
23+
python-version: '3.9'
24+
25+
- name: Install dependencies
26+
run: |
27+
python -m pip install --upgrade pip
28+
pip install mypy
29+
pip install -r requirements.txt
30+
31+
- name: Run mypy
32+
run: mypy google/genai/ --config-file=google/genai/mypy.ini

google/genai/mypy.ini

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
[mypy]
2+
exclude = tests/.*
3+
plugins = pydantic.mypy
4+
; these are environment-specific imports
5+
disable_error_code = import-not-found, import-untyped

0 commit comments

Comments
 (0)