diff --git a/requirements.txt b/requirements.txt index fe4a04402..e4d3546a0 100644 --- a/requirements.txt +++ b/requirements.txt @@ -7,6 +7,6 @@ djangorestframework==3.14.0 types-pytz==2022.7.1.0 types-requests==2.28.11.8 types-urllib3==1.26.25.4 -django-stubs==1.13.0 +django-stubs==1.14.0 django-stubs-ext==0.7.0 -e .[compatible-mypy,coreapi,markdown] diff --git a/scripts/typecheck_tests.py b/scripts/typecheck_tests.py index 6a6484e9f..bf71f3561 100644 --- a/scripts/typecheck_tests.py +++ b/scripts/typecheck_tests.py @@ -56,6 +56,7 @@ '"_MonkeyPatchedWSGIResponse" has no attribute "content"', '"_MonkeyPatchedWSGIResponse" has no attribute "data"', '" defined here', + '" has no attribute "id"', ], "authentication": [ 'Argument 1 to "post" of "APIClient" has incompatible type "None"; expected "str', @@ -82,7 +83,6 @@ 'Incompatible types in assignment (expression has type "AsView[GenericView]", variable has type "AsView[Callable[[HttpRequest], Any]]")', # noqa: E501 'Argument "patterns" to "SchemaGenerator" has incompatible type "List[object]"', 'Argument 1 to "field_to_schema" has incompatible type "object"; expected "Field[Any, Any, Any, Any]"', - 'Argument "help_text" to "CharField" has incompatible type "_StrPromise"', '"Module rest_framework.schemas.coreapi" does not explicitly export attribute "coreapi"', ], "browsable_api": [ @@ -91,6 +91,7 @@ "models.py": [ '"ForeignKeyTarget" has no attribute "sources"', '"CustomManager" not callable', + 'Incompatible types in assignment (expression has type "Type[BaseManager[Any]]", variable has type "Type[CustomManager]")', # noqa: E501 ], "test_authtoken.py": [ 'Item "None" of "Optional[Token]" has no attribute "key"', @@ -127,7 +128,8 @@ "test_generics.py": [ 'has incompatible type "str"', '"Response" has no attribute "serializer"', - ' Incompatible types in assignment (expression has type "Type[SlugSerializer]", base class "InstanceView" defined the type as "Type[BasicSerializer]")', # noqa: E501 + 'Incompatible types in assignment (expression has type "Type[SlugSerializer]", base class "InstanceView" defined the type as "Type[BasicSerializer]")', # noqa: E501 + 'Incompatible types in assignment (expression has type "_QuerySet[SlugBasedModel, SlugBasedModel]", base class "InstanceView" defined the type as "_QuerySet[BasicModel, BasicModel]")', # noqa: E501 ], "test_htmlrenderer.py": [ 'to "get_template_names" of "TemplateHTMLRenderer" has incompatible type', @@ -138,12 +140,15 @@ "test_model_serializer.py": [ '"Field[Any, Any, Any, Any]" has no attribute', 'base class "Meta" defined the type as', + '"OneFieldModel" has no attribute "additional_attr"', ], "test_negotiation.py": ['has incompatible type "None"'], "test_pagination.py": [ "(not iterable)", 'has incompatible type "range"', 'expected "Iterable[Any]"', + 'Value of type variable "_MT" of "paginate_queryset" of "CursorPagination" cannot be "object"', + 'Value of type "Union[object, Any]" is not indexable', ], "test_parsers.py": ['"object" has no attribute', 'Argument 1 to "isnan" has incompatible type'], "test_permissions.py": [ @@ -160,7 +165,6 @@ 'Argument 2 to "re_path" has incompatible type "Callable[[], None]"; expected "Callable[..., HttpResponseBase]"', # noqa: E501 ], "test_relations_pk.py": [ - '"OneToOneTarget" has no attribute "id"', '"Field[Any, Any, Any, Any]" has no attribute "get_queryset', ], "test_renderers.py": [ @@ -180,9 +184,6 @@ '"BasenameTestCase" has no attribute "router"', 'Unexpected keyword argument "use_regex_path" for "SimpleRouter"', ], - "test_reverse.py": [ - 'Incompatible types in assignment (expression has type "MockVersioningScheme", variable has type "Optional[BaseVersioning]', # noqa: E501 - ], "test_serializer.py": [ "base class", '"CharField" has incompatible type "Collection[Any]"',