Skip to content

Commit 092ec42

Browse files
authored
Update Black to 23.1.0 and reformat with new style (#335)
Black 23 introduced some changes to the stable formatting style, but very trivial in this project. More details: https://github.com/psf/black/blob/main/CHANGES.md#2310
1 parent e55f354 commit 092ec42

File tree

2 files changed

+6
-9
lines changed

2 files changed

+6
-9
lines changed

.pre-commit-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ repos:
2020
hooks:
2121
- id: isort
2222
- repo: https://github.com/psf/black
23-
rev: 22.12.0
23+
rev: 23.1.0
2424
hooks:
2525
- id: black
2626
- repo: https://github.com/PyCQA/flake8

rest_framework-stubs/serializers.pyi

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,14 @@
11
from collections.abc import Callable, Iterable, Iterator, Mapping, MutableMapping, Sequence
22
from typing import Any, Generic, NoReturn, TypeVar
3-
from _typeshed import Self
43

4+
from _typeshed import Self
55
from django.core.exceptions import ValidationError as DjangoValidationError
66
from django.db import models
77
from django.db.models import DurationField as ModelDurationField
88
from django.db.models import Manager, Model, QuerySet
99
from django.db.models.fields import Field as DjangoModelField
10-
from django.utils.translation import ugettext_lazy as _
1110
from django.utils.functional import cached_property
12-
from typing_extensions import Literal
13-
11+
from django.utils.translation import ugettext_lazy as _
1412
from rest_framework.exceptions import APIException as APIException
1513
from rest_framework.exceptions import AuthenticationFailed as AuthenticationFailed
1614
from rest_framework.exceptions import ErrorDetail as ErrorDetail
@@ -67,7 +65,8 @@ from rest_framework.relations import SlugRelatedField as SlugRelatedField
6765
from rest_framework.relations import StringRelatedField as StringRelatedField
6866
from rest_framework.utils.model_meta import FieldInfo, RelationInfo
6967
from rest_framework.utils.serializer_helpers import BindingDict, BoundField, ReturnDict, ReturnList
70-
from rest_framework.validators import Validator, UniqueTogetherValidator, BaseUniqueForValidator
68+
from rest_framework.validators import BaseUniqueForValidator, UniqueTogetherValidator, Validator
69+
from typing_extensions import Literal
7170

7271
LIST_SERIALIZER_KWARGS: Sequence[str]
7372
ALL_FIELDS: str
@@ -126,9 +125,7 @@ class SerializerMetaclass(type):
126125
def as_serializer_error(exc: Exception) -> dict[str, list[ErrorDetail]]: ...
127126

128127
class Serializer(
129-
BaseSerializer[
130-
_IN,
131-
],
128+
BaseSerializer[_IN],
132129
metaclass=SerializerMetaclass,
133130
):
134131
_declared_fields: dict[str, Field]

0 commit comments

Comments
 (0)