File tree Expand file tree Collapse file tree 2 files changed +66
-3
lines changed
Expand file tree Collapse file tree 2 files changed +66
-3
lines changed Original file line number Diff line number Diff line change @@ -36,6 +36,15 @@ repos:
3636 hooks :
3737 # lint github actions workflow yaml
3838 - id : actionlint
39-
40- # # Suggest to add pytest hook that runs unit test | Prerequisite: split unit/integration test
41- # # https://github.com/datajoint/datajoint-python/issues/1211
39+ - repo : https://github.com/pre-commit/mirrors-mypy
40+ rev : v1.14.1
41+ hooks :
42+ - id : mypy
43+ files : ^src/datajoint/
44+ additional_dependencies :
45+ - pydantic
46+ - pydantic-settings
47+ - types-PyMySQL
48+ - types-tqdm
49+ - pandas-stubs
50+ - numpy
Original file line number Diff line number Diff line change @@ -152,6 +152,60 @@ quote-style = "double"
152152indent-style = " space"
153153line-ending = " auto"
154154
155+ [tool .mypy ]
156+ python_version = " 3.10"
157+ ignore_missing_imports = true
158+ # Start with lenient settings, gradually enable stricter checks
159+ warn_return_any = false
160+ warn_unused_ignores = false
161+ disallow_untyped_defs = false
162+ disallow_incomplete_defs = false
163+ check_untyped_defs = true
164+
165+ # Modules with complete type coverage - strict checking enabled
166+ [[tool .mypy .overrides ]]
167+ module = [
168+ " datajoint.content_registry" ,
169+ ]
170+ disallow_untyped_defs = true
171+ disallow_incomplete_defs = true
172+ warn_return_any = true
173+
174+ # Modules excluded from type checking until fully typed
175+ [[tool .mypy .overrides ]]
176+ module = [
177+ " datajoint.admin" ,
178+ " datajoint.autopopulate" ,
179+ " datajoint.blob" ,
180+ " datajoint.builtin_codecs" ,
181+ " datajoint.cli" ,
182+ " datajoint.codecs" ,
183+ " datajoint.condition" ,
184+ " datajoint.connection" ,
185+ " datajoint.declare" ,
186+ " datajoint.dependencies" ,
187+ " datajoint.diagram" ,
188+ " datajoint.errors" ,
189+ " datajoint.expression" ,
190+ " datajoint.gc" ,
191+ " datajoint.hash" ,
192+ " datajoint.heading" ,
193+ " datajoint.jobs" ,
194+ " datajoint.lineage" ,
195+ " datajoint.logging" ,
196+ " datajoint.migrate" ,
197+ " datajoint.objectref" ,
198+ " datajoint.preview" ,
199+ " datajoint.schemas" ,
200+ " datajoint.settings" ,
201+ " datajoint.staged_insert" ,
202+ " datajoint.storage" ,
203+ " datajoint.table" ,
204+ " datajoint.user_tables" ,
205+ " datajoint.utils" ,
206+ ]
207+ ignore_errors = true
208+
155209[tool .setuptools ]
156210packages = [" datajoint" ]
157211package-dir = {"" = " src" }
You can’t perform that action at this time.
0 commit comments