Skip to content

Commit c107c3b

Browse files
committed
Add static typing
1 parent 8213ecd commit c107c3b

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

src/execution_order.py

+9-5
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,12 @@
44
import os
55
import subprocess
66
from get_remote_modules import get_remote_module
7-
from typing import TextIO, List, Tuple, Dict, Any
7+
from typing import TextIO, List, Tuple, Dict, Any, cast, Union
8+
89

910
def run_command(command: List[str], **kwargs: Dict[str, Any]):
1011
is_timeout = False
11-
p = subprocess.Popen(command, shell=False, stdout=subprocess.PIPE, stderr=subprocess.PIPE, **kwargs)
12+
p = subprocess.Popen(command, shell=False, stdout=subprocess.PIPE, stderr=subprocess.PIPE, **kwargs) # type: ignore
1213
try:
1314
stdout, stderr = p.communicate(timeout=5)
1415
except subprocess.TimeoutExpired as e:
@@ -97,9 +98,12 @@ def handle_meta_modules(modules: List[Tuple[str,str]]) -> Tuple[List[Tuple[str,s
9798
modules_to_modules_folder[module] = module_folder
9899
break
99100

100-
if not found_local:
101+
if not found_local and module:
101102
# TODO: Handle update
102-
found_remote, module_folder = get_remote_module(module)
103+
found_remote, module_folder_remote = get_remote_module(module)
104+
if module_folder_remote is not None:
105+
module_folder = module_folder_remote
106+
103107
modules_to_modules_folder[module] = module_folder
104108

105109

@@ -112,7 +116,7 @@ def handle_meta_modules(modules: List[Tuple[str,str]]) -> Tuple[List[Tuple[str,s
112116
# Meta module detected
113117
print(f"Running: {meta_module_path}")
114118
print(f"ENV: {os.environ['BASE_BOARD']}")
115-
submodules, meta_module_errors, is_timeout = run_command(meta_module_path)
119+
submodules, meta_module_errors, is_timeout = run_command([meta_module_path])
116120
submodules = submodules.strip()
117121
print(f"Adding in modules: {submodules}")
118122
if meta_module_errors != "" or is_timeout:

0 commit comments

Comments
 (0)