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

Update to mypy 0.991 for compatible-mypy & CI #280

Merged
merged 2 commits into from Nov 16, 2022

Conversation

intgr
Copy link
Contributor

@intgr intgr commented Nov 8, 2022

No description provided.

show_traceback = True
allow_redefinition = True
incremental = True
show_error_codes = False
disable_error_code = empty-body
Copy link
Contributor Author

Choose a reason for hiding this comment

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

warn_no_return is no longer necessary now that we disable empty-body.


class BasePermission(metaclass=BasePermissionMetaclass): # type: ignore[misc]
def has_permission(self, request: Request, view: APIView) -> bool: ...
def has_object_permission(self, request: Request, view: APIView, obj: Any) -> bool: ...
Copy link
Contributor Author

Choose a reason for hiding this comment

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

If I kept _SupportsHasPermission here, it causes "Metaclass conflict" errors.

I don't understand metaclasses well enough to say whether that's a bug in mypy or a genuine issue.

But duplicating these method signatures here fixes it.

@intgr
Copy link
Contributor Author

intgr commented Nov 8, 2022

typecheck-tests is not running correctly any more. All ignores show up in "UNUSED IGNORES" now.

EDIT: May be a mypy bug, reported upstream: python/mypy#14042

scripts/typecheck_tests.py Outdated Show resolved Hide resolved
@intgr intgr force-pushed the update-to-mypy-0.990 branch 2 times, most recently from f2a0737 to 832a704 Compare November 15, 2022 10:02
@intgr intgr changed the title Update to mypy 0.990 for compatible-mypy & CI Update to mypy 0.991 for compatible-mypy & CI Nov 15, 2022
@intgr intgr marked this pull request as ready for review November 15, 2022 10:52
Copy link
Member

@sobolevn sobolevn left a comment

Choose a reason for hiding this comment

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

Thanks!

@sobolevn sobolevn merged commit a1ec425 into typeddjango:master Nov 16, 2022
@intgr
Copy link
Contributor Author

intgr commented Nov 16, 2022

Oops @sobolevn I wanted to delay merging this to avoid creating a new conflict for #286. Probably should have left a comment about that. But hopefully this doesn't conflict.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants