@@ -131,13 +131,14 @@ def build_dependency_graph(nemo_root: str) -> Dict[str, List[str]]:
131131
132132 for file_path in find_python_files (nemo_root ):
133133 relative_path = os .path .relpath (file_path , nemo_root )
134+
134135 parts = relative_path .split (os .sep )
135136
136137 if len (parts ) == 1 or parts [- 1 ] == "__init__.py" or (parts [0 ] != "nemo" and parts [0 ] != "tests" ):
137138 continue
138139
139140 module_path = relative_path .replace (".py" , "" ).replace ("/" , "." )
140- if parts [1 ] in top_level_packages and parts [1 ] != 'collections' :
141+ if parts [1 ] in top_level_packages and parts [1 ] != 'collections' and parts [ 0 ] != 'tests' :
141142 dependencies [module_path ] = list (set (analyze_imports (nemo_root , file_path )))
142143 elif parts [0 ] == 'tests' :
143144 dependencies [module_path ] = [relative_path ]
@@ -228,31 +229,25 @@ def build_dependency_graph(nemo_root: str) -> Dict[str, List[str]]:
228229 or "nemo/collections/tts" in dep
229230 or "nemo/collections/speechlm" in dep
230231 or "nemo/collections/audio" in dep
231- or "tests/collections/asr" in dep
232- or "tests/collections/tts" in dep
233- or "tests/collections/speechlm" in dep
234- or "tests/collections/audio" in dep
235232 ):
236233 new_deps .append ("speech" )
237234
238- if "nemo/export" in dep or "nemo/deploy" in dep or "tests/export" in dep or "tests/deploy" in dep :
235+ if "nemo/export" in dep or "nemo/deploy" in dep :
239236 new_deps .append ("export-deploy" )
240237
241- if (
242- "nemo/collections/llm" in dep
243- or "nemo/collections/vlm" in dep
244- or "nemo/automodel" in dep
245- or "tests/collections/llm" in dep
246- or "tests/collections/vlm" in dep
247- or "tests/automodel" in dep
248- ):
238+ if "nemo/collections/llm" in dep or "nemo/collections/vlm" in dep or "nemo/automodel" in dep :
249239 new_deps .append ("automodel" )
250240
251241 if "tests" in dep and "tests/functional_tests" not in dep :
252242 new_deps .append ("unit-tests" )
253- continue
254243
255- else :
244+ if (
245+ "nemo/collections" in deps
246+ and "nemo/collections/asr" not in dep
247+ and "nemo/collections/tts" not in dep
248+ and "nemo/collections/speechlm" not in dep
249+ and "nemo/collections/audio" not in dep
250+ ):
256251 new_deps .append ("nemo2" )
257252
258253 bucket_deps [package ] = sorted (list (set (new_deps )))
0 commit comments