It's a tradeoff. For a project under active development, I personally would recommend upgrading to django-stubs 5.0.0
even if you use an older Django version. But be aware of the caveats below.
We still regularly fix issues and increase typing precision of features that Django has supported for a long time. Even as a Django 4.2 user, you would benefit from those improvements.
"Partial support" for older Django versionsAccording to our "Version compatibility" table, Django 4.1 and 4.2 remain with "partial support" by django-stubs 5.0.0. What partial support means in practice is:
django-stubs
contains some symbol, you can't be sure your older Django version necessarily supports it.(Of course mistakes can happen, please let us know if these are not upheld. And in general I would be interested to hear abou your experence)
Supported mypy versionI'd like to upgrade is because I'm otherwise restricted to Mypy 1.7.x, which is now several minor versions behind the latest.
Many years ago, mypy compatibility was finnicky because mypy regularly made backwards-incompatible changes to the plugin API. That's why the compatible-mypy
extra was introduced.
More recently, mypy has been fairly stable. IMO mypy compatibility is more of a suggestion. I regularly violate the mypy version constraint in my own projects, I usually upgrade to newest mypy when it comes out. But at times I've also been a few versions behind (when there were bugs in mypy that affected me). I don't think I ever experienced any issues because of incompatible mypy version.
Of course there are no guarantees. Just do a full mypy run in CI, and don't merge the mypy update if there are obvious issues.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4