You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When type-checking a repository with src/ structure, there can be conflicts between installed Python modules, and directories which are located at the root of the repository (assuming that is the CWD for running mypy).
I stumbled upon this by having a directory called docker/, while also having https://pypi.org/project/docker/ installed.
As far as I could tell, there's currently no satisfactory way for mypy to accept this, besides renaming the directory.
Happy to take a stab at implementing this, if you feel it's worth adding.
Feature
Add an option (name TBD) to ignore the current directory when looking for namespace package bases.
As far as I can tell, the behavior would have to be modified here (optionally leaving out
[os.getcwd()]
:mypy/mypy/find_sources.py
Line 87 in 695ea30
Pitch
When type-checking a repository with
src/
structure, there can be conflicts between installed Python modules, and directories which are located at the root of the repository (assuming that is the CWD for runningmypy
).I stumbled upon this by having a directory called
docker/
, while also having https://pypi.org/project/docker/ installed.As far as I could tell, there's currently no satisfactory way for
mypy
to accept this, besides renaming the directory.Happy to take a stab at implementing this, if you feel it's worth adding.
Related discussion: #8584
The text was updated successfully, but these errors were encountered: