Skip to content

Unexpected [mypy].config_discovery behavior #23533

Description

@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

Pants Version

2.32.0

Additional Info

Some related issues touching on how mypy's config_discovery probably should behave:

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions