You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[1.15 regression] mypy does not use $HOME/.mypy.ini, if .git directory exists #18650
After upgrading to mypy 1.15.0, I found mypy no longer reads configuration from ~/.mypy.ini. This seems to happen if project directory has directory .git, even if no other configuration is provided, for instance in pyproject.toml.
For testing purposes, I created faulty configuration.
~/.mypy.ini:
[mypy]
incorrect = True
With mypy 1.14.0:
suonpaa@deb:~/src/test$ mypy --version
mypy 1.14.0 (compiled: yes)
suonpaa@deb:~/src/test$ mypy .
/home/suonpaa/.mypy.ini: [mypy]: Unrecognized option: incorrect = True
Success: no issues found in 1 source file
suonpaa@deb:~/src/test$ mkdir .git
suonpaa@deb:~/src/test$ mypy .
/home/suonpaa/.mypy.ini: [mypy]: Unrecognized option: incorrect = True
Success: no issues found in 1 source file
With mypy 1.15.0:
suonpaa@deb:~/src/test$ mypy --version
mypy 1.15.0 (compiled: yes)
suonpaa@deb:~/src/test$ mypy .
../../.mypy.ini: [mypy]: Unrecognized option: incorrect = True
Success: no issues found in 1 source file
suonpaa@deb:~/src/test$ mkdir .git
suonpaa@deb:~/src/test$ mypy .
Success: no issues found in 1 source file
suonpaa@deb:~/src/test$
Just to be clear: no mypy.ini or pyproject.toml in this directory or in its parents.
I would expect this change being related to #16965 and / or #18482.
changed the title [-]mypy 1.15.0 does not use $HOME/.mypy.ini, if .git directory exists[/-][+][1.15 regression] mypy does not use $HOME/.mypy.ini, if .git directory exists[/+]on Feb 12, 2025
Activity
A5rocks commentedon Feb 10, 2025
This also checks for .hg, relevant change is #18482. Note this is explicitly checked so maybe this is now intentional.
cc @hauntsaninja
Fix regression for user config files
hauntsaninja commentedon Feb 10, 2025
Thanks for the report! #18656
[-]mypy 1.15.0 does not use $HOME/.mypy.ini, if .git directory exists[/-][+][1.15 regression] mypy does not use $HOME/.mypy.ini, if .git directory exists[/+]Fix regression for user config files (python#18656)
Fix regression for user config files (python#18656)
Fix regression for user config files (python#18656)
Fix regression for user config files (python#18656)