Skip to content

Treat relative paths in config file relative to config file, not cwd #7967

@blueyed

Description

@blueyed

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_path': lambda s: [expand_path(p.strip()) for p in re.split('[,:]', s)],

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions