Skip to content

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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
domsj-foodpairing opened this issue Mar 17, 2025 · 0 comments
Labels
feature topic-configuration Configuration files and flags

Comments

@domsj-foodpairing
Copy link

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
@domsj-foodpairing domsj-foodpairing added the bug mypy got something wrong label Mar 17, 2025
@brianschubert brianschubert added the topic-configuration Configuration files and flags label Mar 17, 2025
@A5rocks A5rocks added feature and removed bug mypy got something wrong labels Mar 17, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature topic-configuration Configuration files and flags
Projects
None yet
Development

No branches or pull requests

3 participants