MCPcopy Create free account
hub / github.com/pytorch/executorch / get_required_submodule_paths

Function get_required_submodule_paths

install_executorch.py:111–129  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

109
110
111def get_required_submodule_paths():
112 gitmodules_path = os.path.join(os.getcwd(), ".gitmodules")
113
114 if not os.path.isfile(gitmodules_path):
115 logger.error(".gitmodules file not found.")
116 exit(1)
117
118 with open(gitmodules_path, "r") as file:
119 lines = file.readlines()
120
121 # Extract paths of required submodules
122 required_paths = {}
123 for line in lines:
124 if line.strip().startswith("path ="):
125 path = line.split("=")[1].strip()
126 for submodule, file_name in REQUIRED_SUBMODULES.items():
127 if submodule in path:
128 required_paths[path] = file_name
129 return required_paths
130
131
132def check_and_update_submodules():

Callers 1

Calls 2

splitMethod · 0.80
itemsMethod · 0.80

Tested by

no test coverage detected