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
It seems that since #4498, when you do from module.submodule import something, Mypy adds a reference both to module.submodule AND to module. If in addition module imports functionalities from its submodules, then all of them become transitive dependencies, and so on.
The end result of this is that the SCC ends including almost every file in my library, so when I modify ANYTHING the cache is discarded and must be rebuilt again from almost zero, causing unbearable static analysis times.
Supposedly, the dependency to the parent module is more correct from a semantic point of view, as Python executes that module before importing the submodule. However by the same logic all parents should be added as dependencies, and this is not done. Given the current implementation it could be possible to break the dependencies by putting each module in its own folder, so either I am missing something or that logic makes no sense at all.
To Reproduce
Any import of module.submodule causes a dependency on module.
Expected Behavior
If a submodule is imported, the dependency should be on that submodule ONLY.
Actual Behavior
A bogus dependency to module is added.
Your Environment
Mypy version used: mypy 0.971 (compiled: yes)
Mypy command-line flags: Irrelevant AFAIK
Mypy configuration options from mypy.ini (and other config files): Irrelevant AFAIK
Python version used: 3.8
Operating system and version: Linux Ubuntu 18.04.6 LTS
The text was updated successfully, but these errors were encountered:
Bug Report
It seems that since #4498, when you do
from module.submodule import something
, Mypy adds a reference both tomodule.submodule
AND tomodule
. If in additionmodule
imports functionalities from its submodules, then all of them become transitive dependencies, and so on.The end result of this is that the SCC ends including almost every file in my library, so when I modify ANYTHING the cache is discarded and must be rebuilt again from almost zero, causing unbearable static analysis times.
Supposedly, the dependency to the parent module is more correct from a semantic point of view, as Python executes that module before importing the submodule. However by the same logic all parents should be added as dependencies, and this is not done. Given the current implementation it could be possible to break the dependencies by putting each module in its own folder, so either I am missing something or that logic makes no sense at all.
To Reproduce
Any import of
module.submodule
causes a dependency onmodule
.Expected Behavior
If a submodule is imported, the dependency should be on that submodule ONLY.
Actual Behavior
A bogus dependency to
module
is added.Your Environment
mypy.ini
(and other config files): Irrelevant AFAIKThe text was updated successfully, but these errors were encountered: