mirror of
https://github.com/davidhalter/django-stubs.git
synced 2026-02-21 17:18:31 +08:00
Fix CI (#1108)
* Fix CI
* Fix CI
* Fix CI
* Fix CI
* APply black
* APply black
* Fix mypy
* Fix mypy errors in django-stubs
* Fix format
* Fix plugin
* Do not patch builtins by default
* Fix mypy
* Only run mypy on 3.10 for now
* Only run mypy on 3.10 for now
* WHAT THE HELL
* Enable strict mode in mypy
* Enable strict mode in mypy
* Fix tests
* Fix tests
* Debug
* Debug
* Fix tests
* Fix tests
* Add TYPE_CHECKING debug
* Caching maybe?
* Caching maybe?
* Try explicit `${{ matrix.python-version }}`
* Remove debug
* Fix typing
* Finally
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
import sys
|
||||
from functools import partial
|
||||
from typing import Callable, Dict, List, Optional, Tuple
|
||||
from typing import Callable, Dict, List, Optional, Tuple, Type
|
||||
|
||||
from django.db.models.fields.related import RelatedField
|
||||
from mypy.modulefinder import mypy_path
|
||||
@@ -72,7 +72,7 @@ class NewSemanalDjangoPlugin(Plugin):
|
||||
def _get_current_queryset_bases(self) -> Dict[str, int]:
|
||||
model_sym = self.lookup_fully_qualified(fullnames.QUERYSET_CLASS_FULLNAME)
|
||||
if model_sym is not None and isinstance(model_sym.node, TypeInfo):
|
||||
return helpers.get_django_metadata(model_sym.node).setdefault(
|
||||
return helpers.get_django_metadata(model_sym.node).setdefault( # type: ignore[no-any-return]
|
||||
"queryset_bases", {fullnames.QUERYSET_CLASS_FULLNAME: 1}
|
||||
)
|
||||
else:
|
||||
@@ -81,7 +81,7 @@ class NewSemanalDjangoPlugin(Plugin):
|
||||
def _get_current_manager_bases(self) -> Dict[str, int]:
|
||||
model_sym = self.lookup_fully_qualified(fullnames.MANAGER_CLASS_FULLNAME)
|
||||
if model_sym is not None and isinstance(model_sym.node, TypeInfo):
|
||||
return helpers.get_django_metadata(model_sym.node).setdefault(
|
||||
return helpers.get_django_metadata(model_sym.node).setdefault( # type: ignore[no-any-return]
|
||||
"manager_bases", {fullnames.MANAGER_CLASS_FULLNAME: 1}
|
||||
)
|
||||
else:
|
||||
@@ -90,7 +90,7 @@ class NewSemanalDjangoPlugin(Plugin):
|
||||
def _get_current_model_bases(self) -> Dict[str, int]:
|
||||
model_sym = self.lookup_fully_qualified(fullnames.MODEL_CLASS_FULLNAME)
|
||||
if model_sym is not None and isinstance(model_sym.node, TypeInfo):
|
||||
return helpers.get_django_metadata(model_sym.node).setdefault(
|
||||
return helpers.get_django_metadata(model_sym.node).setdefault( # type: ignore[no-any-return]
|
||||
"model_bases", {fullnames.MODEL_CLASS_FULLNAME: 1}
|
||||
)
|
||||
else:
|
||||
@@ -99,7 +99,7 @@ class NewSemanalDjangoPlugin(Plugin):
|
||||
def _get_current_form_bases(self) -> Dict[str, int]:
|
||||
model_sym = self.lookup_fully_qualified(fullnames.BASEFORM_CLASS_FULLNAME)
|
||||
if model_sym is not None and isinstance(model_sym.node, TypeInfo):
|
||||
return helpers.get_django_metadata(model_sym.node).setdefault(
|
||||
return helpers.get_django_metadata(model_sym.node).setdefault( # type: ignore[no-any-return]
|
||||
"baseform_bases",
|
||||
{
|
||||
fullnames.BASEFORM_CLASS_FULLNAME: 1,
|
||||
@@ -305,5 +305,5 @@ class NewSemanalDjangoPlugin(Plugin):
|
||||
return None
|
||||
|
||||
|
||||
def plugin(version):
|
||||
def plugin(version: str) -> Type[NewSemanalDjangoPlugin]:
|
||||
return NewSemanalDjangoPlugin
|
||||
|
||||
Reference in New Issue
Block a user