Skip to content

Setting module search path in the config file #2323

Closed
@JukkaL

Description

@JukkaL

I wonder if we should support configuring the module search path (equivalent to MYPYPATH) in the mypy config file. I have a feeling that this was discussed before, but maybe we can revisit this.

Here's one particular use case I'm thinking about: specifying a directory for custom stubs. For example, I could have a stubs/ subdirectory in my repository for custom stubs that I've written. It seems reasonable to be able to add this directory to the search path automatically so I won't always have to use a script that sets MYPYPATH for running mypy correctly. If I use --silent-imports, a mypy run with accidentally missing search path items will pass without errors and can easily generate false negatives.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions