]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
pybind/mgr: Upgrade to mypy 0.901
authorSebastian Wagner <sewagner@redhat.com>
Wed, 9 Jun 2021 12:08:10 +0000 (14:08 +0200)
committerSebastian Wagner <sewagner@redhat.com>
Thu, 10 Jun 2021 11:28:10 +0000 (13:28 +0200)
Signed-off-by: Sebastian Wagner <sewagner@redhat.com>
src/pybind/mgr/dashboard/controllers/iscsi.py
src/pybind/mgr/dashboard/controllers/rbd_mirroring.py
src/pybind/mgr/dashboard/plugins/debug.py
src/pybind/mgr/dashboard/plugins/feature_toggles.py
src/pybind/mgr/dashboard/plugins/plugin.py
src/pybind/mgr/tox.ini

index 1c9cd378f70dc38a492255d473837ff9ace6be6b..35de24c9b1424df96e093f7bd5265bc737f94aae 100644 (file)
@@ -6,6 +6,7 @@
 import json
 import re
 from copy import deepcopy
+from typing import Any, Dict, List, no_type_check
 
 import cherrypy
 import rados
@@ -26,11 +27,6 @@ from . import ApiController, BaseController, ControllerDoc, Endpoint, \
     EndpointDoc, ReadPermission, RESTController, Task, UiApiController, \
     UpdatePermission
 
-try:
-    from typing import Any, Dict, List, no_type_check
-except ImportError:
-    no_type_check = object()  # Just for type checking
-
 ISCSI_SCHEMA = {
     'user': (str, 'username'),
     'password': (str, 'password'),
index dffc513fdaa546387ffc6990afb8581e33ed6cb9..b2bc86b4adc1b1c39de6eb4c8c0f895c304ea77f 100644 (file)
@@ -4,6 +4,7 @@ import json
 import logging
 import re
 from functools import partial
+from typing import no_type_check
 
 import cherrypy
 import rbd
@@ -18,12 +19,6 @@ from . import ApiController, BaseController, ControllerDoc, Endpoint, \
     EndpointDoc, ReadPermission, RESTController, Task, UpdatePermission, \
     allow_empty_body
 
-try:
-    from typing import no_type_check
-except ImportError:
-    no_type_check = object()  # Just for type checking
-
-
 logger = logging.getLogger('controllers.rbd_mirror')
 
 
index da5a4fb9577a7c953741cbb9c11402167d6c3209..8c6bfb007885199169bc6d04cf641ea71b10161c 100644 (file)
@@ -3,16 +3,12 @@
 
 import json
 from enum import Enum
+from typing import no_type_check
 
 from . import PLUGIN_MANAGER as PM
 from . import interfaces as I  # noqa: E741,N812
 from .plugin import SimplePlugin as SP
 
-try:
-    from typing import no_type_check
-except ImportError:
-    no_type_check = object()  # Just for type checking
-
 
 class Actions(Enum):
     ENABLE = 'enable'
index 8dc865096a45267d80e86a5d1d09eae4213cac8a..1811be258a788f3e63f2e031e0a35dbdbde98d38 100644 (file)
@@ -1,7 +1,7 @@
 # -*- coding: utf-8 -*-
 
 from enum import Enum
-from typing import List, Optional
+from typing import List, Optional, Set, no_type_check
 
 import cherrypy
 from mgr_module import CLICommand, Option
@@ -17,11 +17,6 @@ from . import PLUGIN_MANAGER as PM
 from . import interfaces as I  # noqa: E741,N812
 from .ttl_cache import ttl_cache
 
-try:
-    from typing import Set, no_type_check
-except ImportError:
-    no_type_check = object()  # Just for type checking
-
 
 class Features(Enum):
     RBD = 'rbd'
index 847a61872677f80e6603c5d3ac2358b39374b1f3..120fb30aacb66231844ea965b220c7e9f81269d0 100644 (file)
@@ -1,13 +1,10 @@
+from typing import no_type_check
+
 from mgr_module import Command, Option
 
 from . import PLUGIN_MANAGER as PM
 from . import interfaces as I  # noqa: E741,N812
 
-try:
-    from typing import no_type_check
-except ImportError:
-    no_type_check = object()  # Just for type checking
-
 
 class SimplePlugin(I.CanMgr, I.HasOptions, I.HasCommands):
     """
index f7304a7680e70b95c479f5a49c61d6b62dcdd315..d85ab66a276eb8de54e539022c037eea6ed49874 100644 (file)
@@ -58,7 +58,12 @@ basepython = python3
 deps =
     cython
     -rrequirements.txt
-    mypy==0.812
+    mypy==0.901
+    types-backports
+    types-python-dateutil
+    types-requests
+    types-PyYAML
+    types-jwt
 commands =
     mypy --config-file=../../mypy.ini \
            -m alerts \