Skip to content

Commit

Permalink
Update to mypy 0.991 for compatible-mypy & CI
Browse files Browse the repository at this point in the history
  • Loading branch information
intgr committed Nov 15, 2022
1 parent 89f8925 commit f2a0737
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 3 deletions.
3 changes: 2 additions & 1 deletion mypy.ini
Expand Up @@ -2,10 +2,11 @@
strict_optional = True
ignore_missing_imports = True
check_untyped_defs = True
warn_no_return = False
show_traceback = True
allow_redefinition = True
incremental = True
show_error_codes = False
disable_error_code = empty-body

plugins =
mypy_django_plugin.main,
Expand Down
6 changes: 5 additions & 1 deletion rest_framework-stubs/permissions.pyi
Expand Up @@ -44,7 +44,11 @@ class NOT(_SupportsHasPermission):
def __init__(self, op1: _SupportsHasPermission) -> None: ...

class BasePermissionMetaclass(OperationHolderMixin, type): ... # type: ignore[misc]
class BasePermission(_SupportsHasPermission, metaclass=BasePermissionMetaclass): ... # type: ignore[misc]

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: ...

class AllowAny(BasePermission): ...
class IsAuthenticated(BasePermission): ...
class IsAdminUser(BasePermission): ...
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Expand Up @@ -28,7 +28,7 @@ def find_stub_files(name):
]

extras_require = {
"compatible-mypy": ["mypy>=0.980,<0.990"],
"compatible-mypy": ["mypy>=0.991,<0.1000"],
"coreapi": ["coreapi>=2.0.0"],
"markdown": ["types-Markdown>=0.1.5"],
}
Expand Down
2 changes: 2 additions & 0 deletions tests/plugins.ini
@@ -1,5 +1,7 @@
[mypy]
check_untyped_defs = True
show_error_codes = False
disable_error_code = empty-body
plugins =
mypy_django_plugin.main,
mypy_drf_plugin.main
Expand Down

0 comments on commit f2a0737

Please sign in to comment.