From 52b6d63e14cae0317eb5d1fad5921db4cf122ac9 Mon Sep 17 00:00:00 2001 From: Christian Bundy Date: Mon, 6 Feb 2023 12:33:23 -0800 Subject: [PATCH 1/3] Upgrade to Mypy 1.0 --- requirements.txt | 2 +- setup.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/requirements.txt b/requirements.txt index 36f13e8a8..778400c77 100644 --- a/requirements.txt +++ b/requirements.txt @@ -9,4 +9,4 @@ psycopg2-binary -e .[compatible-mypy] # Overrides: -mypy==0.991 +mypy==1.0.0 diff --git a/setup.py b/setup.py index 19ec016db..11a5ae240 100644 --- a/setup.py +++ b/setup.py @@ -31,7 +31,7 @@ def find_stub_files(name: str) -> List[str]: ] extras_require = { - "compatible-mypy": ["mypy>=0.991,<1.0"], + "compatible-mypy": ["mypy>=1.0,<1.1"], } setup( From 50381e5c9bce183125e96f8823596487563d7c64 Mon Sep 17 00:00:00 2001 From: Christian Bundy Date: Mon, 6 Feb 2023 12:38:20 -0800 Subject: [PATCH 2/3] Add type ignore for unreachable code --- mypy_django_plugin/transformers/managers.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mypy_django_plugin/transformers/managers.py b/mypy_django_plugin/transformers/managers.py index fdc506c84..19e176a25 100644 --- a/mypy_django_plugin/transformers/managers.py +++ b/mypy_django_plugin/transformers/managers.py @@ -251,7 +251,7 @@ def create_manager_info_from_from_queryset_call( # In some cases, due to the way the semantic analyzer works, only # passed_queryset.name is available. But it should be analyzed again, # so this isn't a problem. - return None + return None # type: ignore[unreachable] if len(call_expr.args) == 2 and isinstance(call_expr.args[1], StrExpr): manager_name = call_expr.args[1].value From 64496eca14bbaffdb7a83746cd450635531d8d66 Mon Sep 17 00:00:00 2001 From: Christian Bundy Date: Mon, 6 Feb 2023 12:44:09 -0800 Subject: [PATCH 3/3] Remove unused type ignores --- django-stubs/db/models/fields/files.pyi | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/django-stubs/db/models/fields/files.pyi b/django-stubs/db/models/fields/files.pyi index e5f098389..f9ed18c27 100644 --- a/django-stubs/db/models/fields/files.pyi +++ b/django-stubs/db/models/fields/files.pyi @@ -70,7 +70,7 @@ class FileField(Field): error_messages: _ErrorMessagesT | None = ..., ) -> None: ... # class access - @overload # type: ignore + @overload def __get__(self, instance: None, owner: Any) -> FileDescriptor: ... # Model instance access @overload @@ -98,7 +98,7 @@ class ImageField(FileField): **kwargs: Any, ) -> None: ... # class access - @overload # type: ignore + @overload def __get__(self, instance: None, owner: Any) -> ImageFileDescriptor: ... # Model instance access @overload