File tree Expand file tree Collapse file tree 2 files changed +4
-3
lines changed Expand file tree Collapse file tree 2 files changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -365,9 +365,9 @@ def _parse_and_extend_config_file(
365365 return None
366366 visited .add (abs_file_read )
367367
368- if not os . environ . get ( "MYPY_CONFIG_FILE_DIR" ) :
369- # set it only if unset to allow for path variable expansions when parsing below,
370- # so recursive calls for config extend references won't overwrite it
368+ if len ( visited ) == 1 :
369+ # set it only after the first config file is visited to allow for path variable expansions
370+ # when parsing below, so recursive calls for config extend references won't overwrite it
371371 os .environ ["MYPY_CONFIG_FILE_DIR" ] = os .path .dirname (abs_file_read )
372372
373373 mypy_updates : dict [str , object ] = {}
Original file line number Diff line number Diff line change @@ -174,6 +174,7 @@ def set_strict_flags() -> None:
174174 assert strict_option_set is True
175175 assert options .ignore_missing_imports_per_module is True
176176 assert options .config_file == str (pyproject .name )
177+ assert os .environ ["MYPY_CONFIG_FILE_DIR" ] == str (pyproject .parent )
177178
178179 assert options .per_module_options ["c" ] == {
179180 "disable_error_code" : [],
You can’t perform that action at this time.
0 commit comments