Skip to content
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

Stubs are out of date #255

Open
simonwhitaker opened this issue Jun 19, 2024 · 1 comment
Open

Stubs are out of date #255

simonwhitaker opened this issue Jun 19, 2024 · 1 comment
Labels
enhancement New feature or request

Comments

@simonwhitaker
Copy link

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 (microsoft/pylance-release#6029) and they directed me to you.

@sbdchd
Copy link
Owner

sbdchd commented Aug 26, 2024

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants