Closed dakotahorstman closed 1 year ago
I don't have much experience with pre-commit
, so I don't know how to help you :(
Darn, okay. Maybe pinging @asottile will bring some light?
Well, this suddenly started working and I have no idea why. I haven't touched anything related to django-stubs and yet it seems like things are working. Will still keep this open until I am confident it works or until I can find out why for sure.
Sounds like it might be related to .mypy_cache
I have it working in pre-commit environments for my open source projects and clients. I don't think there's anything django-stubs can do here. It really does sound like a .mypy_cache
issue, or Docker sync/configuration issue.
I agree. I deleted the cache directory and it appears to be working now. Will close this issue now that I'm confident that's the root cause.
Bug report
What's wrong
It would appear django-stubs is not integrating properly in my pre-commit environment. This is similar to #1087 in that I also encountered the same issues as that ticket, but have since moved beyond. The exact error I'm getting is:
and the fields in my model:
and my pre-commit configuration:
and my
pyproject.toml
:When running mypy directly in my environment, I do not get these same errors from mypy. I should also note that I'm running in a Docker container as a normal user, not root.
System information
python
version: 3.11.4django
version: 4.2.3mypy
version: 1.4.1django-stubs
version: 4.2.3django-stubs-ext
version: 4.2.2