Skip to content

Commit 755260e

Browse files
committed
Fix errors in CI
1 parent e46f90e commit 755260e

File tree

5 files changed

+11
-2
lines changed

5 files changed

+11
-2
lines changed

pyproject.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,6 @@ line_length = 120
77
multi_line_output = 3
88
include_trailing_comma = true
99
profile = 'black'
10+
11+
[build-system]
12+
requires = ["setuptools<64", "wheel"]

requirements.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,6 @@ pytest==7.1.2
55
pytest-mypy-plugins==1.9.3
66
djangorestframework==3.13.1
77
types-pytz==2022.1.2
8+
django-stubs==1.12.0
9+
django-stubs-ext==0.5.0
810
-e .[compatible-mypy,coreapi,markdown]

rest_framework-stubs/decorators.pyi

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,13 +48,15 @@ _MIXED_CASE_HTTP_VERBS = List[
4848
"PUT",
4949
"PATCH",
5050
"TRACE",
51+
"HEAD",
5152
"OPTIONS",
5253
"get",
5354
"post",
5455
"delete",
5556
"put",
5657
"patch",
5758
"trace",
59+
"head",
5860
"options",
5961
]
6062
]

rest_framework-stubs/permissions.pyi

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,8 @@ class OR(_SupportsHasPermission):
4343
class NOT(_SupportsHasPermission):
4444
def __init__(self, op1: _SupportsHasPermission) -> None: ...
4545

46-
class BasePermissionMetaclass(OperationHolderMixin, type): ...
47-
class BasePermission(_SupportsHasPermission, metaclass=BasePermissionMetaclass): ...
46+
class BasePermissionMetaclass(OperationHolderMixin, type): ... # type: ignore[misc]
47+
class BasePermission(_SupportsHasPermission, metaclass=BasePermissionMetaclass): ... # type: ignore[misc]
4848
class AllowAny(BasePermission): ...
4949
class IsAuthenticated(BasePermission): ...
5050
class IsAdminUser(BasePermission): ...

scripts/typecheck_tests.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,8 @@
157157
'"ResolverMatch" has incompatible type "str"; expected "Callable[..., Any]"',
158158
"_SupportsHasPermission",
159159
"Invalid type alias: expression is not a valid type",
160+
'"object" not callable',
161+
'Cannot assign multiple types to name "composed_perm" without an explicit "Type[...]" annotation',
160162
],
161163
"test_relations.py": [
162164
'Invalid index type "int" for "Union[str, List[Any], Dict[str, Any]]"; expected type "str"',

0 commit comments

Comments
 (0)