Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix errors in CI #273

Merged
merged 1 commit into from
Nov 7, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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