mypy: Enable local_partial_types.

dmypy is innately incompatible with `local_partial_types` being
`False` as it uses fined-grained incremental mode for caching.

We need to enable `local_partial_types` for mypy as well so that the two
will behave the same way.

This requires us to add additional type annotation in certain siuations
but that's fine.

Signed-off-by: Zixuan James Li <p359101898@gmail.com>
This commit is contained in:
Zixuan James Li 2022-06-30 15:23:36 -04:00 committed by Tim Abbott
parent bf9f9c8b5d
commit b3f27b1843
2 changed files with 5 additions and 1 deletions

View File

@ -38,6 +38,10 @@ show_error_codes = true
# Warn of unreachable or redundant code. # Warn of unreachable or redundant code.
warn_unreachable = true warn_unreachable = true
# dmypy enables local_partial_types implicitly. We need mypy to align
# with this behavior.
local_partial_types = true
[[tool.mypy.overrides]] [[tool.mypy.overrides]]
module = ["zproject.configured_settings", "zproject.settings"] module = ["zproject.configured_settings", "zproject.settings"]
no_implicit_reexport = false no_implicit_reexport = false

View File

@ -338,7 +338,7 @@ def print_listeners() -> None:
print() print()
children = [] children: List["subprocess.Popen[bytes]"] = []
async def serve() -> None: async def serve() -> None: