Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade to Mypy 1.0 #1360

Merged
merged 3 commits into from
Feb 7, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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"],
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need to bump the minimum, or is that the policy? Seems like there's no braking changes here?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This only affects those that use django-stubs[compatible-mypy], yes we bump lower bound in that case.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah right, nvm me, I'm blind 😇

}

setup(
Expand Down