Closed zero323 closed 3 years ago
Forget that, please.
Just for the context ‒ I am trying to investigate some issues related to caching behavior. When testing project with complex dependencies, I see serious performance degradation compared to running internal mypy tests.
I thought the issue was here, but it seems it might be actually with find_dependent_paths
Since it uses at least main.py
it includes all kinds of packages with main.py
, 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, and break caching in general.
I might be wrong, but it seems like the conditions for invoking cache removal has been unintentionally reversed:
https://github.com/typeddjango/pytest-mypy-plugins/blob/a2d4adde12b0024e62f2e1661fd0dd5abb4f9191/pytest_mypy_plugins/item.py#L297-L304
As-is, cache is removed when
disable_cache
isFalse
and preserved when it isTrue
.