Skip to content

Commit

Permalink
Make --cache-fine-grained imply --local-partial-types
Browse files Browse the repository at this point in the history
dmypy requires local-partial-types, so without specifying it, we generate
a cache that is useless to dmypy.

Prompted by #10735.
  • Loading branch information
msullivan committed Jun 29, 2021
1 parent a8c32c9 commit abd528f
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions mypy/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit abd528f

Please sign in to comment.