-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
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
Treat relative paths in config file relative to config file, not cwd #7967
Comments
Closing, since we implemented #7968 |
I thought about this again because of #9751 and I'm reopening: |
Another possible approach, rather than to specify paths relative to the config file, would be to set the cwd for both discovering and interpreting config files to be the root of the package that mypy is being invoked from. That way:
|
When using
mypy_path = src
it should be treated relative to the config file (if any), not the current working directory.This also applies to the default of
cache_dir
(.cache_dir
), which currently gets created in the current working directory always.I.e. a detected/found (project) config file could be treated as the root for options with relative defaults also.
As for
mypy_path
this could be achieved in the type callback, which then however would need the config file / root as a new argument:mypy/mypy/config_parser.py
Line 75 in 84126ab
As for global user config files, it should treat relative files therein relative to it, but it should not be used as a root for default settings like cache_dir.
The text was updated successfully, but these errors were encountered: