diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 2be551170..221584c00 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -17,7 +17,7 @@ repos: args: [--fix=lf] - id: check-case-conflict - repo: https://github.com/astral-sh/ruff-pre-commit - rev: v0.9.4 + rev: v0.9.6 hooks: - id: ruff args: ["--fix", "--exit-non-zero-on-fix"] diff --git a/django-stubs/db/models/query.pyi b/django-stubs/db/models/query.pyi index 3cc3fed92..a03e2b928 100644 --- a/django-stubs/db/models/query.pyi +++ b/django-stubs/db/models/query.pyi @@ -13,7 +13,6 @@ from typing_extensions import Self, TypeAlias, TypeVar, deprecated _T = TypeVar("_T", covariant=True) _Model = TypeVar("_Model", bound=Model, covariant=True) _Row = TypeVar("_Row", covariant=True, default=_Model) # ONLY use together with _Model -_QS = TypeVar("_QS", bound=_QuerySet) _TupleT = TypeVar("_TupleT", bound=tuple[Any, ...], covariant=True) MAX_GET_RESULTS: int @@ -60,7 +59,7 @@ class QuerySet(Generic[_Model, _Row], Iterable[_Row], Sized): def as_manager(cls) -> Manager[_Model]: ... def __len__(self) -> int: ... def __bool__(self) -> bool: ... - def __class_getitem__(cls: type[_QS], item: type[_Model]) -> type[_QS]: ... + def __class_getitem__(cls, item: type[_Model]) -> Self: ... def __getstate__(self) -> dict[str, Any]: ... # Technically, the other QuerySet must be of the same type _T, but _T is covariant def __and__(self, other: QuerySet[_Model, _Row]) -> Self: ... @@ -228,7 +227,7 @@ class RawQuerySet(Iterable[_Model], Sized): def using(self, alias: str | None) -> RawQuerySet[_Model]: ... # Deprecated alias of QuerySet, for compatibility only. -_QuerySet: TypeAlias = QuerySet +_QuerySet: TypeAlias = QuerySet # noqa: PYI047 class Prefetch: prefetch_through: str