typeddjango / django-stubs

PEP-484 stubs for Django
MIT License
1.59k stars 444 forks source link

Include current `django-stubs` version in reporting of config data #2338

Open flaeppe opened 2 months ago

flaeppe commented 2 months ago

I'm not 100% sure but I think that if you change version of django-stubs but keep the same version of mypy after a cached run, mypy reuses the cache and there could possibly be crashes or all sorts of, strange, errors emitted for the second run.

But if we're able to include the current django-stubs version when we report config data in

https://github.com/typeddjango/django-stubs/blob/f04323aaec46118125484248fbd9c00966f0ed0e/mypy_django_plugin/main.py#L307-L314

We should get "automatic" cache tainting whenever switching between django-stubs versions.

I must admit that I haven't gotten around to try out if this is indeed a problem, it's just a suspicion so far. Gonna have to see if I can find 2 django-stubs versions and a snippet of code that backs up my suspicion here. Think I've recently run in to this in one of the projects I'm working on though.

What's wrong

How is that should be

System information

sobolevn commented 2 months ago

Yes, good idea!

sobolevn commented 2 months ago

and django version too.