@@ -374,7 +374,7 @@ def _run(self):
374374 if parameters ["enable_always_target" ]:
375375 always_target_tasks = {
376376 t .label
377- for t in full_task_graph .tasks .values () # type: ignore
377+ for t in full_task_graph .tasks .values ()
378378 if t .attributes .get ("always_target" )
379379 if parameters ["enable_always_target" ] is True
380380 or t .kind in parameters ["enable_always_target" ]
@@ -388,7 +388,7 @@ def _run(self):
388388 target_graph = full_task_graph .graph .transitive_closure (requested_tasks )
389389 target_task_graph = TaskGraph (
390390 {l : all_tasks [l ] for l in target_graph .nodes },
391- target_graph , # type: ignore
391+ target_graph ,
392392 )
393393 yield self .verify (
394394 "target_task_graph" , target_task_graph , graph_config , parameters
@@ -446,19 +446,28 @@ def verify(self, name, *args, **kwargs):
446446 return name , args [0 ]
447447
448448
449- def load_tasks_for_kind (parameters , kind , root_dir = None ):
449+ def load_tasks_for_kinds (parameters , kinds , root_dir = None ):
450450 """
451- Get all the tasks of a given kind .
451+ Get all the tasks of the given kinds .
452452
453453 This function is designed to be called from outside of taskgraph.
454454 """
455455 # make parameters read-write
456456 parameters = dict (parameters )
457- parameters ["target-kinds" ] = [ kind ]
457+ parameters ["target-kinds" ] = kinds
458458 parameters = parameters_loader (spec = None , strict = False , overrides = parameters )
459459 tgg = TaskGraphGenerator (root_dir = root_dir , parameters = parameters )
460460 return {
461461 task .task ["metadata" ]["name" ]: task
462462 for task in tgg .full_task_set
463- if task .kind == kind
463+ if task .kind in kinds
464464 }
465+
466+
467+ def load_tasks_for_kind (parameters , kind , root_dir = None ):
468+ """
469+ Get all the tasks of a given kind.
470+
471+ This function is designed to be called from outside of taskgraph.
472+ """
473+ return load_tasks_for_kinds (parameters , [kind ], root_dir )
0 commit comments