Skip to content

Commit e96cd34

Browse files
chore(internal): move mypy configurations to pyproject.toml file
1 parent f0d8624 commit e96cd34

File tree

2 files changed

+52
-50
lines changed

2 files changed

+52
-50
lines changed

mypy.ini

Lines changed: 0 additions & 50 deletions
This file was deleted.

pyproject.toml

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -195,6 +195,58 @@ reportOverlappingOverload = false
195195
reportImportCycles = false
196196
reportPrivateUsage = false
197197

198+
[tool.mypy]
199+
pretty = true
200+
show_error_codes = true
201+
202+
# Exclude _files.py because mypy isn't smart enough to apply
203+
# the correct type narrowing and as this is an internal module
204+
# it's fine to just use Pyright.
205+
#
206+
# We also exclude our `tests` as mypy doesn't always infer
207+
# types correctly and Pyright will still catch any type errors.
208+
exclude = ['src/agentex/_files.py', '_dev/.*.py', 'tests/.*']
209+
210+
strict_equality = true
211+
implicit_reexport = true
212+
check_untyped_defs = true
213+
no_implicit_optional = true
214+
215+
warn_return_any = true
216+
warn_unreachable = true
217+
warn_unused_configs = true
218+
219+
# Turn these options off as it could cause conflicts
220+
# with the Pyright options.
221+
warn_unused_ignores = false
222+
warn_redundant_casts = false
223+
224+
disallow_any_generics = true
225+
disallow_untyped_defs = true
226+
disallow_untyped_calls = true
227+
disallow_subclassing_any = true
228+
disallow_incomplete_defs = true
229+
disallow_untyped_decorators = true
230+
cache_fine_grained = true
231+
232+
# By default, mypy reports an error if you assign a value to the result
233+
# of a function call that doesn't return anything. We do this in our test
234+
# cases:
235+
# ```
236+
# result = ...
237+
# assert result is None
238+
# ```
239+
# Changing this codegen to make mypy happy would increase complexity
240+
# and would not be worth it.
241+
disable_error_code = "func-returns-value,overload-cannot-match"
242+
243+
# https://github.com/python/mypy/issues/12162
244+
[[tool.mypy.overrides]]
245+
module = "black.files.*"
246+
ignore_errors = true
247+
ignore_missing_imports = true
248+
249+
198250
[tool.ruff]
199251
line-length = 120
200252
output-format = "grouped"

0 commit comments

Comments
 (0)