sbdchd / django-types

:doughnut: Type stubs for Django
MIT License
186 stars 62 forks source link

Stubs are out of date #255

Open simonwhitaker opened 2 months ago

simonwhitaker commented 2 months ago

The stubs in this repo are considerably out of date with upstream. This can be seen clearly in https://github.com/sbdchd/django-types/blob/main/django-stubs/utils/deprecation.pyi, where I see this snippet:

class RemovedInDjango30Warning(PendingDeprecationWarning): ...
class RemovedInDjango31Warning(PendingDeprecationWarning): ...
class RemovedInDjango40Warning(PendingDeprecationWarning): ...
class RemovedInNextVersionWarning(DeprecationWarning): ...

Compare with the head of upstream:

class RemovedInDjango60Warning(DeprecationWarning):
    pass

class RemovedInDjango61Warning(PendingDeprecationWarning):
    pass

RemovedInNextVersionWarning = RemovedInDjango60Warning
RemovedAfterNextVersionWarning = RemovedInDjango61Warning

This is a problem, because Microsoft's Pylance extension for VSCode uses this repo for the source of its bundled Django stubs. As a result, if I enable type checking in a modern Django project (Django 5.0.x), I get a lot of erroneous type errors, such as this:

Screenshot 2024-06-18 at 5 06 14 PM

I reported this as an issue in Pylance (https://github.com/microsoft/pylance-release/issues/6029) and they directed me to you.

sbdchd commented 2 weeks ago

yeah stubs will fall behind, I only added things that I've needed when I've need them rather than trying to keep 1:1 with Django

for instance, in my django project I don't use admin so there wasn't any admin definitions, but someone else needed them so they added them to this project