-
-
Notifications
You must be signed in to change notification settings - Fork 115
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This is a PR similar to typeddjango/django-stubs#1253, only for rest_framework-stubs. All statements that are unclear on how to proceed are marked with # noqa: in the code, with the exception of compat.pyi, which has additional rules turned off in setup.cfg. * configure flake8-pyi plugin in pre-commit * fix Y015 * fix Y037 * use PEP 585 container types where possible, replace obsolete typing types with collections.abc * disable Y041 rule * add typealias annotation where feasible, add self annotations * fix failing tests, silence remaining warnings since unclear how to proceed * address review * amend tests * amend rebase error Signed-off-by: Oleg Hoefling <oleg.hoefling@ionos.com>
- Loading branch information
Showing
56 changed files
with
1,073 additions
and
1,123 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
default_app_config: str = ... | ||
default_app_config: str |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
from rest_framework import serializers | ||
|
||
class AuthTokenSerializer(serializers.Serializer): | ||
username: serializers.CharField = ... | ||
password: serializers.CharField = ... | ||
token: serializers.CharField = ... | ||
username: serializers.CharField | ||
password: serializers.CharField | ||
token: serializers.CharField |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,12 @@ | ||
from typing import Any, Type | ||
from typing import Any | ||
|
||
from rest_framework.request import Request | ||
from rest_framework.response import Response | ||
from rest_framework.serializers import Serializer | ||
from rest_framework.views import APIView, AsView, GenericView | ||
|
||
class ObtainAuthToken(APIView): | ||
serializer_class: Type[Serializer] = ... | ||
serializer_class: type[Serializer] | ||
def post(self, request: Request, *args: Any, **kwargs: Any) -> Response: ... | ||
|
||
obtain_auth_token: AsView[GenericView] = ... | ||
obtain_auth_token: AsView[GenericView] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
from typing import Any, List | ||
from typing import Any | ||
|
||
def pagination_system_check(app_configs: Any, **kwargs: Any) -> List[Any]: ... | ||
def pagination_system_check(app_configs: Any, **kwargs: Any) -> list[Any]: ... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,42 +1,43 @@ | ||
from typing import Any, Callable, Optional, Sequence, Type | ||
from collections.abc import Callable, Sequence | ||
from typing import Any | ||
|
||
from rest_framework.renderers import BaseRenderer | ||
from rest_framework.schemas import SchemaGenerator | ||
from rest_framework.urlpatterns import _AnyURL | ||
|
||
def get_docs_view( | ||
title: Optional[str] = ..., | ||
url: Optional[str] = ..., | ||
description: Optional[str] = ..., | ||
urlconf: Optional[str] = ..., | ||
renderer_classes: Optional[Sequence[Type[BaseRenderer]]] = ..., | ||
title: str | None = ..., | ||
url: str | None = ..., | ||
description: str | None = ..., | ||
urlconf: str | None = ..., | ||
renderer_classes: Sequence[type[BaseRenderer]] | None = ..., | ||
public: bool = ..., | ||
patterns: Optional[Sequence[_AnyURL]] = ..., | ||
generator_class: Type[SchemaGenerator] = ..., | ||
patterns: Sequence[_AnyURL] | None = ..., | ||
generator_class: type[SchemaGenerator] = ..., | ||
authentication_classes: Sequence[str] = ..., | ||
permission_classes: Sequence[str] = ..., | ||
) -> Callable[..., Any]: ... | ||
def get_schemajs_view( | ||
title: Optional[str] = ..., | ||
url: Optional[str] = ..., | ||
description: Optional[str] = ..., | ||
urlconf: Optional[str] = ..., | ||
renderer_classes: Optional[Sequence[Type[BaseRenderer]]] = ..., | ||
title: str | None = ..., | ||
url: str | None = ..., | ||
description: str | None = ..., | ||
urlconf: str | None = ..., | ||
renderer_classes: Sequence[type[BaseRenderer]] | None = ..., | ||
public: bool = ..., | ||
patterns: Optional[Sequence[_AnyURL]] = ..., | ||
generator_class: Type[SchemaGenerator] = ..., | ||
patterns: Sequence[_AnyURL] | None = ..., | ||
generator_class: type[SchemaGenerator] = ..., | ||
authentication_classes: Sequence[str] = ..., | ||
permission_classes: Sequence[str] = ..., | ||
) -> Callable[..., Any]: ... | ||
def include_docs_urls( | ||
title: Optional[str] = ..., | ||
url: Optional[str] = ..., | ||
description: Optional[str] = ..., | ||
urlconf: Optional[str] = ..., | ||
renderer_classes: Optional[Sequence[Type[BaseRenderer]]] = ..., | ||
title: str | None = ..., | ||
url: str | None = ..., | ||
description: str | None = ..., | ||
urlconf: str | None = ..., | ||
renderer_classes: Sequence[type[BaseRenderer]] | None = ..., | ||
public: bool = ..., | ||
patterns: Optional[Sequence[_AnyURL]] = ..., | ||
generator_class: Type[SchemaGenerator] = ..., | ||
patterns: Sequence[_AnyURL] | None = ..., | ||
generator_class: type[SchemaGenerator] = ..., | ||
authentication_classes: Sequence[str] = ..., | ||
permission_classes: Sequence[str] = ..., | ||
) -> Any: ... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.