Skip to content

Commit fddecec

Browse files
authored
CI: Use django-stubs 1.14.0 for testing (#346)
Needs changes to our typecheck ignores.
1 parent 0f8579f commit fddecec

File tree

2 files changed

+8
-7
lines changed

2 files changed

+8
-7
lines changed

requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,6 @@ djangorestframework==3.14.0
77
types-pytz==2022.7.1.0
88
types-requests==2.28.11.8
99
types-urllib3==1.26.25.4
10-
django-stubs==1.13.0
10+
django-stubs==1.14.0
1111
django-stubs-ext==0.7.0
1212
-e .[compatible-mypy,coreapi,markdown]

scripts/typecheck_tests.py

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@
5656
'"_MonkeyPatchedWSGIResponse" has no attribute "content"',
5757
'"_MonkeyPatchedWSGIResponse" has no attribute "data"',
5858
'" defined here',
59+
'" has no attribute "id"',
5960
],
6061
"authentication": [
6162
'Argument 1 to "post" of "APIClient" has incompatible type "None"; expected "str',
@@ -82,7 +83,6 @@
8283
'Incompatible types in assignment (expression has type "AsView[GenericView]", variable has type "AsView[Callable[[HttpRequest], Any]]")', # noqa: E501
8384
'Argument "patterns" to "SchemaGenerator" has incompatible type "List[object]"',
8485
'Argument 1 to "field_to_schema" has incompatible type "object"; expected "Field[Any, Any, Any, Any]"',
85-
'Argument "help_text" to "CharField" has incompatible type "_StrPromise"',
8686
'"Module rest_framework.schemas.coreapi" does not explicitly export attribute "coreapi"',
8787
],
8888
"browsable_api": [
@@ -91,6 +91,7 @@
9191
"models.py": [
9292
'"ForeignKeyTarget" has no attribute "sources"',
9393
'"CustomManager" not callable',
94+
'Incompatible types in assignment (expression has type "Type[BaseManager[Any]]", variable has type "Type[CustomManager]")', # noqa: E501
9495
],
9596
"test_authtoken.py": [
9697
'Item "None" of "Optional[Token]" has no attribute "key"',
@@ -127,7 +128,8 @@
127128
"test_generics.py": [
128129
'has incompatible type "str"',
129130
'"Response" has no attribute "serializer"',
130-
' Incompatible types in assignment (expression has type "Type[SlugSerializer]", base class "InstanceView" defined the type as "Type[BasicSerializer]")', # noqa: E501
131+
'Incompatible types in assignment (expression has type "Type[SlugSerializer]", base class "InstanceView" defined the type as "Type[BasicSerializer]")', # noqa: E501
132+
'Incompatible types in assignment (expression has type "_QuerySet[SlugBasedModel, SlugBasedModel]", base class "InstanceView" defined the type as "_QuerySet[BasicModel, BasicModel]")', # noqa: E501
131133
],
132134
"test_htmlrenderer.py": [
133135
'to "get_template_names" of "TemplateHTMLRenderer" has incompatible type',
@@ -138,12 +140,15 @@
138140
"test_model_serializer.py": [
139141
'"Field[Any, Any, Any, Any]" has no attribute',
140142
'base class "Meta" defined the type as',
143+
'"OneFieldModel" has no attribute "additional_attr"',
141144
],
142145
"test_negotiation.py": ['has incompatible type "None"'],
143146
"test_pagination.py": [
144147
"(not iterable)",
145148
'has incompatible type "range"',
146149
'expected "Iterable[Any]"',
150+
'Value of type variable "_MT" of "paginate_queryset" of "CursorPagination" cannot be "object"',
151+
'Value of type "Union[object, Any]" is not indexable',
147152
],
148153
"test_parsers.py": ['"object" has no attribute', 'Argument 1 to "isnan" has incompatible type'],
149154
"test_permissions.py": [
@@ -160,7 +165,6 @@
160165
'Argument 2 to "re_path" has incompatible type "Callable[[], None]"; expected "Callable[..., HttpResponseBase]"', # noqa: E501
161166
],
162167
"test_relations_pk.py": [
163-
'"OneToOneTarget" has no attribute "id"',
164168
'"Field[Any, Any, Any, Any]" has no attribute "get_queryset',
165169
],
166170
"test_renderers.py": [
@@ -180,9 +184,6 @@
180184
'"BasenameTestCase" has no attribute "router"',
181185
'Unexpected keyword argument "use_regex_path" for "SimpleRouter"',
182186
],
183-
"test_reverse.py": [
184-
'Incompatible types in assignment (expression has type "MockVersioningScheme", variable has type "Optional[BaseVersioning]', # noqa: E501
185-
],
186187
"test_serializer.py": [
187188
"base class",
188189
'"CharField" has incompatible type "Collection[Any]"',

0 commit comments

Comments
 (0)