<#23533 Unexpected `[mypy].config_discovery` behav...
# github-notifications
q
#23533 Unexpected `[mypy].config_discovery` behavior Issue created by zach-overflow Problem Description The docs for `[mypy].config_discovery` state:
If
true
, Pants will include any relevant config files during runs (
mypy.ini
,
.mypy.ini
, and
setup.cfg
).
Use
[mypy].config
instead if your config is in a non-standard location.
However, the mypy subsystem will only discover mypy configs in the build root, while ignoring any/all mypy configs elsewhere. This contradicts the "pants will include any relevant config files" statement from the quote above. Additionally, the current behavior of
[mypy].config_discovery
does not comport with mypy's definition of "config discovery":
By default, mypy will discover configuration files by walking up the file system (up until the root of a repository or the root of the filesystem).
Relevant source code • Mypy's ConfigFilesRequest construction using discovery patterns only matching the build root. • The config discovery behavior in the pants.core.util_rules.config_files:find_config_files rule Pants Version
2.32.0
Additional Info Some related issues touching on how mypy's
config_discovery
probably should behave: • #17739 • #17749 • #22403 pantsbuild/pants