Skip to content

Commit 99a7cb9

Browse files
committed
Try to fix errors in CI
1 parent e46f90e commit 99a7cb9

File tree

7 files changed

+13
-4
lines changed

7 files changed

+13
-4
lines changed

.github/workflows/test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,4 +67,4 @@ jobs:
6767
pip install -r ./requirements.txt
6868
6969
- name: Run tests
70-
run: python ./scripts/typecheck_tests.py
70+
run: PYTHONPATH='.' python ./scripts/typecheck_tests.py

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"',

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ def find_stub_files(name):
2020

2121
dependencies = [
2222
"mypy>=0.950",
23-
"django-stubs>=1.11.0",
23+
"django-stubs>=1.12.0",
2424
"typing-extensions>=3.10.0",
2525
"requests>=2.0.0",
2626
"types-requests>=0.1.12",

0 commit comments

Comments
 (0)