File tree 1 file changed +13
-2
lines changed
1 file changed +13
-2
lines changed Original file line number Diff line number Diff line change @@ -77,6 +77,10 @@ def main(script_path: Optional[str],
77
77
if options .non_interactive and not options .install_types :
78
78
fail ("Error: --non-interactive is only supported with --install-types" , stderr , options )
79
79
80
+ if options .install_types and not options .incremental :
81
+ fail ("Error: --install-types not supported with incremental mode disabled" ,
82
+ stderr , options )
83
+
80
84
if options .install_types and not sources :
81
85
install_types (options .cache_dir , formatter , non_interactive = options .non_interactive )
82
86
return
@@ -1090,8 +1094,15 @@ def install_types(cache_dir: str,
1090
1094
non_interactive : bool = False ) -> None :
1091
1095
"""Install stub packages using pip if some missing stubs were detected."""
1092
1096
if not os .path .isdir (cache_dir ):
1093
- sys .stderr .write (
1094
- "Error: no mypy cache directory (you must enable incremental mode)\n " )
1097
+ if not after_run :
1098
+ sys .stderr .write (
1099
+ "Error: Can't determine which types to install with no files to check " +
1100
+ "(and no cache from previous mypy run)\n "
1101
+ )
1102
+ else :
1103
+ sys .stderr .write (
1104
+ "Error: --install-types failed (no mypy cache directory)\n "
1105
+ )
1095
1106
sys .exit (2 )
1096
1107
fnam = build .missing_stubs_file (cache_dir )
1097
1108
if not os .path .isfile (fnam ):
You can’t perform that action at this time.
0 commit comments