@@ -920,11 +920,11 @@ def execute(self, build_plan, zip_stream, query):
920920 "DOCKER TAG ID: %s -> %s" , docker_image , docker_image_tag_id
921921 )
922922 else :
923- # Image not found locally, try to pull it
924- log .info ("Docker image not found locally, pulling: %s" , docker_image )
923+ log .info (
924+ "Docker image not found locally, pulling: %s" , docker_image
925+ )
925926 try :
926927 check_call (docker_pull_command (docker_image ))
927- # Get the image ID after pulling
928928 output = check_output (docker_image_id_command (docker_image ))
929929 if output :
930930 docker_image_tag_id = output .decode ().strip ()
@@ -1022,7 +1022,6 @@ def execute(self, build_plan, zip_stream, query):
10221022 script = action [1 ]
10231023
10241024 if docker and docker_image_tag_id :
1025- # Execute shell commands in Docker container
10261025 if log .isEnabledFor (DEBUG2 ):
10271026 log .debug ("exec shell script in docker..." )
10281027 for line in script .splitlines ():
@@ -1033,22 +1032,22 @@ def execute(self, build_plan, zip_stream, query):
10331032 [
10341033 script ,
10351034 "retcode=$?" ,
1036- "pwd" , # Output final working directory to stdout
1035+ "pwd" ,
10371036 "exit $retcode" ,
10381037 ]
10391038 )
10401039
10411040 # Add chown to fix file ownership (like pip at line 1150-1154)
10421041 chown_mask = "{}:{}" .format (os .getuid (), os .getgid ())
10431042 full_script = "{} && {}" .format (
1044- enhanced_script , shlex_join (["chown" , "-R" , chown_mask , "." ])
1043+ enhanced_script ,
1044+ shlex_join (["chown" , "-R" , chown_mask , "." ]),
10451045 )
10461046
10471047 shell_command = [full_script ]
10481048
1049- # Execute in Docker
10501049 docker_cmd = docker_run_command (
1051- sh_work_dir , # build_root = current working directory
1050+ sh_work_dir ,
10521051 shell_command ,
10531052 query .runtime ,
10541053 image = docker_image_tag_id ,
@@ -1076,16 +1075,17 @@ def execute(self, build_plan, zip_stream, query):
10761075 )
10771076
10781077 # Extract final working directory from stdout
1079- # The 'pwd' command output is in the stdout, but we need to parse it
1078+ # The 'pwd' command output is in stdout, but we need to parse it
10801079 # because there might be other output from the script
10811080 output_lines = result .stdout .strip ().split ("\n " )
10821081 if output_lines :
1083- # The last line should be the pwd output
10841082 final_pwd = output_lines [- 1 ]
10851083 # Map container path back to host path
10861084 # Container path structure: /var/task = sh_work_dir (via volume mount)
10871085 if final_pwd .startswith ("/var/task" ):
1088- relative_path = final_pwd [len ("/var/task" ) :].lstrip ("/" )
1086+ relative_path = final_pwd [len ("/var/task" ) :].lstrip (
1087+ "/"
1088+ )
10891089 sh_work_dir = (
10901090 os .path .join (sh_work_dir , relative_path )
10911091 if relative_path
@@ -1096,7 +1096,7 @@ def execute(self, build_plan, zip_stream, query):
10961096 log .debug ("WORKDIR: %s" , sh_work_dir )
10971097
10981098 else :
1099- # Execute shell commands on host (existing behavior)
1099+ # Execute shell commands on host
11001100 with tempfile .NamedTemporaryFile (
11011101 mode = "w+t" , delete = True
11021102 ) as temp_file :
0 commit comments