Skip to content

Commit bc30ef6

Browse files
committed
fix(SR): add missing mypy annotations
Fix errors reported by mypy update (mypy-2.1.0) on our workflow. In `SR.py` on `backends`: ``` drivers/SR.py:51: error: Need type annotation for "backends" (hint: "backends: list[<type>] = ...") [var-annotated] ``` In `test_lock_queue.py`: ``` tests/test_lock_queue.py:15: error: Need type annotation for "saved_queue" (hint: "saved_queue: list[<type>] = ...") [var-annotated] ``` Signed-off-by: Ronan Abhamon <ronan.abhamon@vates.tech>
1 parent 6036431 commit bc30ef6

2 files changed

Lines changed: 5 additions & 3 deletions

File tree

drivers/SR.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@
1818
# SR: Base class for storage repositories
1919
#
2020

21+
from sm_typing import List
22+
2123
import VDI
2224
import xml.dom.minidom
2325
import xs_errors
@@ -48,7 +50,7 @@ def wrapper(self, *args):
4850
return wrapper
4951

5052

51-
backends = []
53+
backends: List["SR"] = []
5254

5355

5456
def registerSR(SRClass):

tests/test_lock_queue.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
from sm_typing import override
1+
from sm_typing import Any, List, override
22

33
import builtins
44
import copy
@@ -12,7 +12,7 @@
1212

1313
## Instead of saving the process queue to disk the mocks will save it here.
1414
## It needs to be global because it is shared between threads.
15-
saved_queue = []
15+
saved_queue: List[Any] = []
1616

1717
def mock_pickle_dump_fn(*args):
1818
global saved_queue

0 commit comments

Comments
 (0)