I am trying to investigate some issues related to caching behavior. When testing project with complex dependencies, I see serious performance degradation (roughly 20 fold on just 36 tests) compared to using mypy.test.testcheckTypeCheckSuite directly.
I thought the issue was a simple logic mistake (#82), but it seems it might be actually with find_dependent_paths
|
py_module = ".".join(path.with_suffix("").parts) |
Since it uses at least main.py it includes all kinds of packages using main as a name (not necessarily as a module name, could be even an argument), for example
['/tmp/.mypy_cache/3.9/pdb',
'/tmp/.mypy_cache/3.9/unittest/main',
'/tmp/.mypy_cache/3.9/unittest/__init__',
'/tmp/.mypy_cache/3.9/_pytest/pytester',
'/tmp/.mypy_cache/3.9/_pytest/config/__init__',
'/tmp/.mypy_cache/3.9/pytest/__init__',
'/tmp/.mypy_cache/3.9/asyncio/runners']
This seems to escalate (in my case, to numpy annotations, for reason yet to be determined), and break caching in general.
Possibly related to #37
Originally posted by @zero323 in #82 (comment)
I am trying to investigate some issues related to caching behavior. When testing project with complex dependencies, I see serious performance degradation (roughly 20 fold on just 36 tests) compared to using
mypy.test.testcheckTypeCheckSuitedirectly.I thought the issue was a simple logic mistake (#82), but it seems it might be actually with
find_dependent_pathspytest-mypy-plugins/pytest_mypy_plugins/item.py
Line 187 in a2d4add
Since it uses at least
main.pyit includes all kinds of packages usingmainas a name (not necessarily as a module name, could be even an argument), for exampleThis seems to escalate (in my case, to
numpyannotations, for reason yet to be determined), and break caching in general.Possibly related to #37
Originally posted by @zero323 in #82 (comment)