@@ -57,35 +57,37 @@ def parse_module_paths(self) -> dict[str, Path]:
5757 # Captures the first name (original) and the path, ignoring any alias
5858 include_pattern = re .compile (r"include\s*\{\s*(\w+).*?\}\s*from\s+['\"]([^'\"]+)['\"]" )
5959
60- # Search in workflows, modules, and subworkflows directories
60+ # Search in root (main.nf), workflows, modules, and subworkflows directories
6161 search_dirs = ["workflows" , "modules" , "subworkflows" ]
6262
63+ nf_files_to_search = list (self .workflow_directory .glob ("*.nf" ))
6364 for search_dir in search_dirs :
6465 search_path = self .workflow_directory / search_dir
6566 if not search_path .exists ():
6667 continue
68+ nf_files_to_search .extend (search_path .rglob ("*.nf" ))
6769
68- for nf_file in search_path . rglob ( "*.nf" ) :
69- try :
70- content = nf_file .read_text ()
71- for match in include_pattern .finditer (content ):
72- process_name = match .group (1 )
73- relative_path = match .group (2 )
70+ for nf_file in nf_files_to_search :
71+ try :
72+ content = nf_file .read_text ()
73+ for match in include_pattern .finditer (content ):
74+ process_name = match .group (1 )
75+ relative_path = match .group (2 )
7476
75- # Only process paths that contain 'modules/'
76- if "modules/" not in relative_path :
77- continue
77+ # Only process paths that contain 'modules/'
78+ if "modules/" not in relative_path :
79+ continue
7880
79- # Extract everything from 'modules/' onwards, removing any '/main' suffix
80- module_path_str = relative_path [relative_path .find ("modules/" ) :]
81- module_path_str = module_path_str .replace ("/main" , "" )
81+ # Extract everything from 'modules/' onwards, removing any '/main' suffix
82+ module_path_str = relative_path [relative_path .find ("modules/" ) :]
83+ module_path_str = module_path_str .replace ("/main" , "" )
8284
83- module_paths [process_name ] = Path (module_path_str )
84- log .debug (f"Found include: { process_name } -> { module_path_str } " )
85+ module_paths [process_name ] = Path (module_path_str )
86+ log .debug (f"Found include: { process_name } -> { module_path_str } " )
8587
86- except OSError as e :
87- log .debug (f"Error parsing { nf_file } : { e } " )
88- continue
88+ except OSError as e :
89+ log .debug (f"Error parsing { nf_file } : { e } " )
90+ continue
8991
9092 return module_paths
9193
@@ -162,7 +164,7 @@ def generate_container_configs(
162164 has_warnings = True
163165 continue
164166 if has_warnings :
165- log .info (
167+ log .debug (
166168 "Generated container configs for the pipeline. Not all containers were found. Run with `-v` to see detailed warning messages."
167169 )
168170 else :
0 commit comments