@@ -52,7 +52,11 @@ def __init__(
5252 else :
5353 self .installed_by = [self .component_type ]
5454
55- def install (self , component : str | dict [str , str ], silent : bool = False ) -> bool :
55+ def install (
56+ self ,
57+ component : str | dict [str , str ],
58+ silent : bool = False ,
59+ ) -> bool :
5660 if isinstance (component , dict ):
5761 # Override modules_repo when the component to install is a dependency from a subworkflow.
5862 remote_url = component .get ("git_remote" , self .current_remote .remote_url )
@@ -167,6 +171,7 @@ def install(self, component: str | dict[str, str], silent: bool = False) -> bool
167171 self .component_type , self .modules_repo , component , version , self .installed_by , install_track
168172 )
169173
174+ dependencies : list [str ] = []
170175 if self .component_type == "subworkflows" :
171176 # Under --skip-deps, don't propagate --force to transitive deps so
172177 # already-installed ones keep their pinned SHAs and just have
@@ -175,11 +180,16 @@ def install(self, component: str | dict[str, str], silent: bool = False) -> bool
175180 original_force = self .force
176181 self .force = False
177182 try :
178- self .install_included_components (component_dir )
183+ dependencies = self .install_included_components (component_dir )
179184 finally :
180185 self .force = original_force
181186 else :
182- self .install_included_components (component_dir )
187+ dependencies = self .install_included_components (component_dir )
188+
189+ if dependencies :
190+ log .info (f"Installed files for '{ component } ' and its dependencies '{ ', ' .join (sorted (dependencies ))} '." )
191+ else :
192+ log .info (f"Installed files for '{ component } '." )
183193
184194 # Update container configs for the installed module. Subworkflows have no container entries of their
185195 # own; their included modules each trigger this when installed above.
@@ -207,29 +217,42 @@ def install(self, component: str | dict[str, str], silent: bool = False) -> bool
207217 Console ().print (
208218 Syntax (f"includeConfig '{ subworkflow_config } '" , "groovy" , theme = "ansi_dark" , padding = 1 )
209219 )
220+
210221 return True
211222
212- def install_included_components (self , subworkflow_dir ):
223+ def install_included_components (self , subworkflow_dir ) -> list [ str ] :
213224 """
214225 Install included modules and subworkflows
215226 """
227+ installed_components : list [str ] = []
216228 ini_modules_repo = self .modules_repo
217229 modules_to_install , subworkflows_to_install = get_components_to_install (subworkflow_dir )
218- for s_install in subworkflows_to_install :
230+ for subworkflow_to_install in subworkflows_to_install :
219231 original_installed = self .installed_by
220232 self .installed_by = [Path (subworkflow_dir ).parts [- 1 ]]
221- self .install (s_install , silent = True )
233+ dependency_installed = self .install (subworkflow_to_install , silent = True )
222234 self .installed_by = original_installed
223- for m_install in modules_to_install :
235+ if dependency_installed :
236+ component_name = (
237+ subworkflow_to_install ["name" ]
238+ if isinstance (subworkflow_to_install , dict )
239+ else subworkflow_to_install
240+ )
241+ installed_components .append (component_name .replace ("/" , "_" ))
242+ for module_to_install in modules_to_install :
224243 original_component_type = self .component_type
225244 self .component_type = "modules"
226245 original_installed = self .installed_by
227246 self .installed_by = [Path (subworkflow_dir ).parts [- 1 ]]
228- self .install (m_install , silent = True )
247+ dependency_installed = self .install (module_to_install , silent = True )
229248 self .component_type = original_component_type
230249 self .installed_by = original_installed
250+ if dependency_installed :
251+ component_name = module_to_install ["name" ] if isinstance (module_to_install , dict ) else module_to_install
252+ installed_components .append (component_name .replace ("/" , "_" ))
231253 # self.install will have modified self.modules_repo. Restore its original value
232254 self .modules_repo = ini_modules_repo
255+ return installed_components
233256
234257 def collect_and_verify_name (
235258 self , component : str | None , modules_repo : "nf_core.modules.modules_repo.ModulesRepo"
0 commit comments