Can't check only submodules (except if installed with pip install -e .
)
#15655
Labels
bug
mypy got something wrong
pip install -e .
)
#15655
Bug Report
Checking a submodule only of a project seems impossible, when not installed using
pip install -e .
Usecase:
I have project that contains auto-generated API code which is not correctly typed.
I only want to check the controllers that are located in a submodule.
To Reproduce
src/example_project/calc.py
:src/ems_example_project/sub/foo.py
:Install the package with
pip install .
OR do not install it at all.Run mypy for the given submodule
mypy src/example_project/sub
Expected Behavior
Only type errors for the submodule are found:
This actually works, if I install the package with
pip install -e .
.But I expect this to work no matter if I install the package normally or not installing it at all.
Actual Behavior
The type errors for the top level modules are also listed.
If I use the option
-p example_project.sub
instead of the path it works as expected. But in my environment I am only able to add specific files (thinkpre-commit
or similar).It also works if I install the package using
pip install -e
.Still I would not expect a such a difference just depending on how I installed the package.
Your Environment
mypy.ini
(and other config files): noneThis might be related to:
The text was updated successfully, but these errors were encountered: