<s> import os <EOL> import subprocess <EOL> import sys <EOL> import glob <EOL> import shutil <EOL> script_dir = os . path . dirname ( os . path . realpath ( __file__ ) ) <EOL> build_script = os . path . join ( script_dir , "<STR_LIT>" ) <EOL> exit_code = <NUM_LIT:0> <EOL> try : <EOL> subprocess . check_call ( [ sys . executable , build_script , "<STR_LIT>" , "<STR_LIT>" , "<STR_LIT>" , "<STR_LIT>" ] ) <EOL> dist_dir = glob . glob ( os . path . join ( script_dir , "<STR_LIT:target>" , "<STR_LIT>" , "<STR_LIT:*>" ) ) [ <NUM_LIT:0> ] <EOL> for src_file in glob . glob ( os . path . join ( dist_dir , "<STR_LIT:*>" ) ) : <EOL> file_name = os . path . basename ( src_file ) <EOL> target_file_name = os . path . join ( script_dir , file_name ) <EOL> if os . path . exists ( target_file_name ) : <EOL> if os . path . isdir ( target_file_name ) : <EOL> os . removedirs ( target_file_name ) <EOL> else : <EOL> os . remove ( target_file_name ) <EOL> shutil . move ( src_file , script_dir ) <EOL> setup_args = sys . argv [ <NUM_LIT:1> : ] <EOL> subprocess . check_call ( [ sys . executable , "<STR_LIT>" ] + setup_args , cwd = script_dir ) <EOL> except subprocess . CalledProcessError as e : <EOL> exit_code = e . returncode <EOL> sys . exit ( exit_code ) </s>
