New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Invalidate mypy cache if config changes #5007
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is great, thanks so much.
Please change the base to main
, if we think it should be backported to v1.10, we can do that easily.
If you want it backported, please also add a change description.
Backporting it later as well would be great. I can open a separate PR for it after this one is merged. The change description in |
No, see https://github.com/pydantic/pydantic/tree/main/changes We have a bot to backport. |
thanks so much. |
* Invalidate mypy cache if config changes * Add docstring * Add change description
Implement
Plugin.report_config_data
to return all plugin config data. For every run, mypy will compare if the data matches the cached one if not the cache is discarded.report_config_data
is called multiple times for every file. I would have liked to usecached_property
but that requires3.8
, unfortunately.https://github.com/python/mypy/blob/v0.991/mypy/plugin.py#L539
This is my first PR here, so I wasn't quite sure which branch to target as this is an issue in both
1.10.x
andmain
. Please let me know if I should change anything and I'll do so.