Skip to content

Commit

Permalink
Fix errors in CI (typeddjango#273)
Browse files Browse the repository at this point in the history
  • Loading branch information
intgr authored Nov 7, 2022
1 parent e46f90e commit ec5ecd4
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 2 deletions.
3 changes: 3 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,6 @@ line_length = 120
multi_line_output = 3
include_trailing_comma = true
profile = 'black'

[build-system]
requires = ["setuptools<64", "wheel"]
2 changes: 2 additions & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,6 @@ pytest==7.1.2
pytest-mypy-plugins==1.9.3
djangorestframework==3.13.1
types-pytz==2022.1.2
django-stubs==1.12.0
django-stubs-ext==0.5.0
-e .[compatible-mypy,coreapi,markdown]
2 changes: 2 additions & 0 deletions rest_framework-stubs/decorators.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -48,13 +48,15 @@ _MIXED_CASE_HTTP_VERBS = List[
"PUT",
"PATCH",
"TRACE",
"HEAD",
"OPTIONS",
"get",
"post",
"delete",
"put",
"patch",
"trace",
"head",
"options",
]
]
Expand Down
4 changes: 2 additions & 2 deletions rest_framework-stubs/permissions.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@ class OR(_SupportsHasPermission):
class NOT(_SupportsHasPermission):
def __init__(self, op1: _SupportsHasPermission) -> None: ...

class BasePermissionMetaclass(OperationHolderMixin, type): ...
class BasePermission(_SupportsHasPermission, metaclass=BasePermissionMetaclass): ...
class BasePermissionMetaclass(OperationHolderMixin, type): ... # type: ignore[misc]
class BasePermission(_SupportsHasPermission, metaclass=BasePermissionMetaclass): ... # type: ignore[misc]
class AllowAny(BasePermission): ...
class IsAuthenticated(BasePermission): ...
class IsAdminUser(BasePermission): ...
Expand Down
2 changes: 2 additions & 0 deletions scripts/typecheck_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,8 @@
'"ResolverMatch" has incompatible type "str"; expected "Callable[..., Any]"',
"_SupportsHasPermission",
"Invalid type alias: expression is not a valid type",
'"object" not callable',
'Cannot assign multiple types to name "composed_perm" without an explicit "Type[...]" annotation',
],
"test_relations.py": [
'Invalid index type "int" for "Union[str, List[Any], Dict[str, Any]]"; expected type "str"',
Expand Down

0 comments on commit ec5ecd4

Please sign in to comment.