@@ -75,16 +75,31 @@ all = ["databasez[jdbc,mysql,aiomysql,odbc,postgresql,sqlite]"]
7575path = " databasez/__init__.py"
7676
7777
78- [tool .mypy ]
79- strict = true
80- disallow_any_generics = false
81- disallow_untyped_decorators = true
82- implicit_reexport = true
83- disallow_incomplete_defs = true
84- disable_error_code = " attr-defined"
85- disallow_untyped_defs = true
86- ignore_missing_imports = true
87- no_implicit_optional = true
78+ [tool .ty ]
79+
80+ [tool .ty .src ]
81+ exclude = [" docs_src/" ]
82+
83+ [tool .ty .terminal ]
84+ error-on-warning = true
85+
86+ [tool .ty .rules ]
87+ unresolved-import = " ignore"
88+ redundant-cast = " ignore"
89+ unused-type-ignore-comment = " ignore"
90+ possibly-missing-attribute = " ignore"
91+ unresolved-attribute = " ignore"
92+ call-top-callable = " ignore"
93+ call-non-callable = " ignore"
94+ invalid-type-form = " ignore"
95+ invalid-parameter-default = " ignore"
96+ invalid-method-override = " ignore"
97+ invalid-assignment = " ignore"
98+ invalid-argument-type = " ignore"
99+ conflicting-declarations = " ignore"
100+ unknown-argument = " ignore"
101+ unsupported-operator = " ignore"
102+ invalid-await = " ignore"
88103
89104[tool .ruff ]
90105extend-exclude = [" docs" ]
@@ -123,20 +138,6 @@ known-third-party = ["ravyn", "starlette", "lilya"]
123138max-line-length = 120
124139max-doc-length = 120
125140
126- [[tool .mypy .overrides ]]
127- module = " databasez.tests.*"
128- ignore_missing_imports = true
129- check_untyped_defs = true
130-
131- [[tool .mypy .overrides ]]
132- module = [" sqlalchemy.*" , " asyncpg" , " alembic" , " sqlalchemy_utils.*" ]
133- ignore_missing_imports = true
134- ignore_errors = true
135-
136- [[tool .mypy .overrides ]]
137- module = " docs_src.*"
138- ignore_errors = true
139-
140141[tool .pytest .ini_options ]
141142addopts = [
142143 " --strict-config" ,
@@ -159,6 +160,8 @@ include = ["/databasez"]
159160[tool .hatch .envs .default ]
160161features = [" all" ]
161162extra-dependencies = [
163+ " ty" ,
164+ " ruff>=0.3.0,<5.0.0" ,
162165 # for debugging
163166 " sqlalchemy_utils" ,
164167 " ipdb>=0.13.13" ,
@@ -168,6 +171,10 @@ extra-dependencies = [
168171[tool .hatch .envs .default .scripts ]
169172clean_pyc = " find . -type f -name \" *.pyc\" -delete"
170173clean_pycache = " find . -type d -name \" *__pycache__*\" -delete"
174+ check_types = " ty check --error-on-warning databasez"
175+ ruff = " hatch fmt --check"
176+ lint = " hatch fmt --check && ty check --error-on-warning databasez"
177+ format = " hatch fmt && hatch fmt --check && ty check --error-on-warning databasez"
171178
172179[tool .hatch .envs .docs ]
173180dependencies = [
@@ -185,10 +192,10 @@ dev = "python scripts/docs.py serve"
185192[tool .hatch .envs .test ]
186193# type-checking
187194features = [" all" ]
188- extra-dependencies = [" mypy>=1.1.0,<2.0.0 " ]
195+ extra-dependencies = [" ty " ]
189196
190197[tool .hatch .envs .test .scripts ]
191- check_types = " mypy -p databasez"
198+ check_types = " ty check --error-on-warning databasez"
192199
193200[tool .hatch .envs .hatch-static-analysis ]
194201# disables custom ruff rules, required to align with pre-commit
@@ -204,7 +211,7 @@ extra-dependencies = [
204211 " sqlalchemy_utils" ,
205212 " ipdb>=0.13.13" ,
206213 " ravyn>=0.3.8" ,
207- " mypy>=1.1.0,<2.0.0 " ,
214+ " ty " ,
208215 " starlette>=0.26.1" ,
209216 " httpx" ,
210217 " psycopg[binary]" ,
0 commit comments