@@ -55,7 +55,7 @@ def format_taskgraph_labels(taskgraph):
5555
5656
5757def format_taskgraph_json (taskgraph ):
58- from taskgraph .util import json
58+ from taskgraph .util import json # noqa: PLC0415
5959
6060 return json .dumps (taskgraph .to_json (), sort_keys = True , indent = 2 )
6161
@@ -69,9 +69,9 @@ def get_filtered_taskgraph(taskgraph, tasksregex, exclude_keys):
6969 Filter all the tasks on basis of a regular expression
7070 and returns a new TaskGraph object
7171 """
72- from taskgraph .graph import Graph
73- from taskgraph .task import Task
74- from taskgraph .taskgraph import TaskGraph
72+ from taskgraph .graph import Graph # noqa: PLC0415
73+ from taskgraph .task import Task # noqa: PLC0415
74+ from taskgraph .taskgraph import TaskGraph # noqa: PLC0415
7575
7676 if tasksregex :
7777 named_links_dict = taskgraph .graph .named_links_dict ()
@@ -117,14 +117,14 @@ def get_filtered_taskgraph(taskgraph, tasksregex, exclude_keys):
117117
118118def get_taskgraph_generator (root , parameters ):
119119 """Helper function to make testing a little easier."""
120- from taskgraph .generator import TaskGraphGenerator
120+ from taskgraph .generator import TaskGraphGenerator # noqa: PLC0415
121121
122122 return TaskGraphGenerator (root_dir = root , parameters = parameters )
123123
124124
125125def format_taskgraph (options , parameters , overrides , logfile = None ):
126- import taskgraph
127- from taskgraph .parameters import parameters_loader
126+ import taskgraph # noqa: PLC0415
127+ from taskgraph .parameters import parameters_loader # noqa: PLC0415
128128
129129 if logfile :
130130 handler = logging .FileHandler (logfile , mode = "w" )
@@ -153,7 +153,7 @@ def format_taskgraph(options, parameters, overrides, logfile=None):
153153
154154
155155def dump_output (out , path = None , params_spec = None ):
156- from taskgraph .parameters import Parameters
156+ from taskgraph .parameters import Parameters # noqa: PLC0415
157157
158158 params_name = Parameters .format_spec (params_spec )
159159 fh = None
@@ -175,7 +175,7 @@ def dump_output(out, path=None, params_spec=None):
175175
176176
177177def generate_taskgraph (options , parameters , overrides , logdir ):
178- from taskgraph .parameters import Parameters
178+ from taskgraph .parameters import Parameters # noqa: PLC0415
179179
180180 def logfile (spec ):
181181 """Determine logfile given a parameters specification."""
@@ -370,8 +370,8 @@ def logfile(spec):
370370 "when multiple parameters files are passed." ,
371371)
372372def show_taskgraph (options ):
373- from taskgraph .parameters import Parameters , parameters_loader
374- from taskgraph .util .vcs import get_repository
373+ from taskgraph .parameters import Parameters , parameters_loader # noqa: PLC0415
374+ from taskgraph .util .vcs import get_repository # noqa: PLC0415
375375
376376 if options .pop ("verbose" , False ):
377377 logging .root .setLevel (logging .DEBUG )
@@ -575,7 +575,7 @@ def show_taskgraph(options):
575575 metavar = "context.tar" ,
576576)
577577def build_image (args ):
578- from taskgraph .docker import build_context , build_image
578+ from taskgraph .docker import build_context , build_image # noqa: PLC0415
579579
580580 validate_docker ()
581581 if args ["context_only" ] is None :
@@ -609,7 +609,10 @@ def build_image(args):
609609 "or mozilla-inbound)" ,
610610)
611611def load_image (args ):
612- from taskgraph .docker import load_image_by_name , load_image_by_task_id
612+ from taskgraph .docker import ( # noqa: PLC0415
613+ load_image_by_name ,
614+ load_image_by_task_id ,
615+ )
613616
614617 if not args .get ("image_name" ) and not args .get ("task_id" ):
615618 print ("Specify either IMAGE-NAME or TASK-ID" )
@@ -641,7 +644,7 @@ def validate_docker():
641644 "contents of the tree." ,
642645)
643646def image_digest (args ):
644- from taskgraph .docker import get_image_digest
647+ from taskgraph .docker import get_image_digest # noqa: PLC0415
645648
646649 try :
647650 digest = get_image_digest (args ["image_name" ])
@@ -668,7 +671,7 @@ def image_digest(args):
668671)
669672@argument ("--user" , default = None , help = "Container user to start shell with." )
670673def load_task (args ):
671- from taskgraph .docker import load_task
674+ from taskgraph .docker import load_task # noqa: PLC0415
672675
673676 validate_docker ()
674677 return load_task (args ["task_id" ], remove = args ["remove" ], user = args ["user" ])
@@ -728,7 +731,7 @@ def load_task(args):
728731 "--verbose" , "-v" , action = "store_true" , help = "include debug-level logging output"
729732)
730733def decision (options ):
731- from taskgraph .decision import taskgraph_decision
734+ from taskgraph .decision import taskgraph_decision # noqa: PLC0415
732735
733736 taskgraph_decision (options )
734737
@@ -753,10 +756,10 @@ def decision(options):
753756 help = "parameters file (.yml or .json; see `taskcluster/docs/parameters.rst`)`" ,
754757)
755758def actions (args ):
756- from taskgraph .actions import render_actions_json
757- from taskgraph .generator import TaskGraphGenerator
758- from taskgraph .parameters import parameters_loader
759- from taskgraph .util import json
759+ from taskgraph .actions import render_actions_json # noqa: PLC0415
760+ from taskgraph .generator import TaskGraphGenerator # noqa: PLC0415
761+ from taskgraph .parameters import parameters_loader # noqa: PLC0415
762+ from taskgraph .util import json # noqa: PLC0415
760763
761764 if args .pop ("verbose" , False ):
762765 logging .root .setLevel (logging .DEBUG )
@@ -782,9 +785,9 @@ def actions(args):
782785 help = "root of the taskgraph definition relative to topsrcdir" ,
783786)
784787def action_callback (options ):
785- from taskgraph .actions import trigger_action_callback
786- from taskgraph .actions .util import get_parameters
787- from taskgraph .util import json
788+ from taskgraph .actions import trigger_action_callback # noqa: PLC0415
789+ from taskgraph .actions .util import get_parameters # noqa: PLC0415
790+ from taskgraph .util import json # noqa: PLC0415
788791
789792 try :
790793 # the target task for this action (or null if it's a group action)
@@ -831,10 +834,10 @@ def action_callback(options):
831834@argument ("--input" , default = None , help = "Action input (.yml or .json)" )
832835@argument ("callback" , default = None , help = "Action callback name (Python function name)" )
833836def test_action_callback (options ):
834- import taskgraph .actions
835- import taskgraph .parameters
836- from taskgraph .config import load_graph_config
837- from taskgraph .util import json , yaml
837+ import taskgraph .actions # noqa: PLC0415
838+ import taskgraph .parameters # noqa: PLC0415
839+ from taskgraph .config import load_graph_config # noqa: PLC0415
840+ from taskgraph .util import json , yaml # noqa: PLC0415
838841
839842 def load_data (filename ):
840843 with open (filename ) as f :
@@ -900,10 +903,10 @@ def load_data(filename):
900903 help = argparse .SUPPRESS , # used for testing
901904)
902905def init_taskgraph (options ):
903- from cookiecutter .main import cookiecutter
906+ from cookiecutter .main import cookiecutter # noqa: PLC0415
904907
905- import taskgraph
906- from taskgraph .util .vcs import get_repository
908+ import taskgraph # noqa: PLC0415
909+ from taskgraph .util .vcs import get_repository # noqa: PLC0415
907910
908911 repo = get_repository (os .getcwd ())
909912 root = Path (repo .path )
0 commit comments