Skip to content

mypy evaluates files config property relative to current working directory iso config file location #18809

Open
@domsj-foodpairing

Description

@domsj-foodpairing

Bug Report

In #18482 support was added for walking up the file system to find the appropriate config file. I wanted to try this out, but ran into a problem.

The config file might contain a section files (and also exclude).
IMO the paths specified there should be considered relative to the location of the config file.

Instead mypy considers them relative to the current working directory (where mypy was invoked).
In order for the 'walk up' functionality to be useful the paths should be interpreted as relative to the config file location.

Actual Behavior

$ mypy
mypy: can't read file 'tests': No such file or directory

Your Environment

  • Mypy version used: 1.15
  • Mypy configuration options from mypy.ini (and other config files): files = tests

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions