From abd528f25581d52d97897c745442a9dc540a2c78 Mon Sep 17 00:00:00 2001 From: "Michael J. Sullivan" Date: Tue, 29 Jun 2021 11:38:36 -0700 Subject: [PATCH] Make --cache-fine-grained imply --local-partial-types dmypy requires local-partial-types, so without specifying it, we generate a cache that is useless to dmypy. Prompted by #10735. --- mypy/main.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/mypy/main.py b/mypy/main.py index 2931b9848bbb..90134de9c438 100644 --- a/mypy/main.py +++ b/mypy/main.py @@ -1009,6 +1009,11 @@ def set_strict_flags() -> None: process_cache_map(parser, special_opts, options) + # An explicitly specified cache_fine_grained implies local_partial_types + # (because otherwise the cache is not compatiable with dmypy) + if options.cache_fine_grained: + options.local_partial_types = True + # Let logical_deps imply cache_fine_grained (otherwise the former is useless). if options.logical_deps: options.cache_fine_grained = True