Skip to content

Commit 6ff1869

Browse files
authored
Add a CI check for type safety check (#16)
1 parent 729e3e7 commit 6ff1869

File tree

2 files changed

+36
-3
lines changed

2 files changed

+36
-3
lines changed

.github/workflows/ci_checks.yml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,26 @@ jobs:
3535
run: |
3636
uv tool run ruff check
3737
38+
type-check:
39+
name: Type Safety Check
40+
runs-on: ubuntu-latest
41+
steps:
42+
- uses: actions/checkout@v4
43+
with:
44+
submodules: true
45+
- name: Set up Python
46+
uses: actions/setup-python@v4
47+
with:
48+
python-version: "3.13"
49+
- name: Set up uv
50+
uses: astral-sh/setup-uv@v1
51+
- name: Install dependencies
52+
run: |
53+
uv sync --extra dev
54+
- name: Run mypy type checker
55+
run: |
56+
uv tool run mypy cadence/
57+
3858
test:
3959
name: Unit Tests
4060
runs-on: ubuntu-latest

pyproject.toml

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -102,24 +102,37 @@ exclude = [
102102
python_version = "3.11"
103103
warn_return_any = true
104104
warn_unused_configs = true
105-
disallow_untyped_defs = true
106-
disallow_incomplete_defs = true
105+
disallow_untyped_defs = false # Temporarily disable to allow CI to pass
106+
disallow_incomplete_defs = false # Temporarily disable to allow CI to pass
107107
check_untyped_defs = true
108-
disallow_untyped_decorators = true
108+
disallow_untyped_decorators = false # Temporarily disable to allow CI to pass
109109
no_implicit_optional = true
110110
warn_redundant_casts = true
111111
warn_unused_ignores = true
112112
warn_no_return = true
113113
warn_unreachable = true
114114
strict_equality = true
115+
explicit_package_bases = true
116+
disable_error_code = [
117+
"var-annotated",
118+
"arg-type",
119+
"attr-defined",
120+
"assignment",
121+
"literal-required",
122+
]
123+
exclude = [
124+
"cadence/api/*", # Exclude entire api directory with generated proto files
125+
]
115126

116127
[[tool.mypy.overrides]]
117128
module = [
118129
"grpcio.*",
119130
"grpcio_tools.*",
131+
"grpc.*",
120132
"thriftpy2.*",
121133
"google.protobuf.*",
122134
"uber.cadence.*",
135+
"msgspec.*",
123136
]
124137
ignore_missing_imports = true
125138

0 commit comments

Comments
 (0)