Skip to content

Commit

Permalink
Upgrade to Mypy 1.0 (#1360)
Browse files Browse the repository at this point in the history
* Upgrade to Mypy 1.0

* Add type ignore for unreachable code

* Remove unused type ignores
  • Loading branch information
christianbundy authored Feb 7, 2023
1 parent b4f1c3c commit 2dcb47c
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions django-stubs/db/models/fields/files.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion mypy_django_plugin/transformers/managers.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@ psycopg2-binary
-e .[compatible-mypy]

# Overrides:
mypy==0.991
mypy==1.0.0
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down

0 comments on commit 2dcb47c

Please sign in to comment.