Disable metadata cache for my own modules.
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 20.6k
- Forks
- 3.3k
- PR merge metrics
- PR metrics pending
Description
Feature
A new configuration option which enables caching for standard library or third-party modules, but not those in my own project.
I define "my own project" as being anything under the current directory, using the test
not os.path.abspath(path).startswith(os.path.abspath('.')
Pitch
This is strictly a speedup in certain situations. In my own situation, I sometimes try to debug mypy. After I have run it on my files, if I want to see how mypy got its results, I have to disable the metadata cache, so that my modules will be parsed and analyzed again. This means that several library modules are fully parsed and analyzed. At least 25 library modules are dependents of builtins and form an SCC. This is slow, especially when running under a debugger -- about two minutes on my system. I'd like to avoid all that time, especially if I wind up launching mypy many times.
There may also conceivably be situations in which my source files haven't changed, but I have different options, or a different set of input files, which could affect the results. I assume that mypy doesn't check to see that the options last used are the same as the ones currently being used.
Another situation is where I am running mypy under Visual Studio and I want to see all the errors that reported. I find that when running incremental, mypy doesn't type check the files for which match the metadata, and thus I don't see the errors. (I think this is a bug, actually).
You might consider some different way of specifying what are "my files".
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by tracing mypy's metadata-cache behavior and how it identifies paths under the current directory. Compare the requested project-only invalidation with the existing incremental behavior described in the issue. Done should include a configuration option that avoids caching the user's modules while retaining caching for standard-library and third-party modules, with behavior verified for repeated runs.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- devtools
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100