#NEWLINE# def wheel( platform_name , wheel_dir , pip_args ) : #NEWLINE# #INDENT# mkdirp ( wheel_dir ) #NEWLINE# with tmpdir ( ) as tempdir : #NEWLINE# #INDENT# import pip #NEWLINE# ret = pip . main ( ( [ 'wheel' , '--wheel-dir' , tempdir ] + list ( pip_args ) ) ) #NEWLINE# if ret : #NEWLINE# #INDENT# return ret #NEWLINE# #UNINDENT# for wheel_filename in os . listdir ( tempdir ) : #NEWLINE# #INDENT# wheel_obj = Wheel ( wheel_filename ) #NEWLINE# if ( wheel_obj . arch != [ 'any' ] ) : #NEWLINE# #INDENT# wheel_obj . arch = [ platform_name ] #NEWLINE# dst = os . path . join ( wheel_dir , wheel_obj . filename ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# dst = os . path . join ( wheel_dir , wheel_filename ) #NEWLINE# #UNINDENT# shutil . copy ( os . path . join ( tempdir , wheel_filename ) , dst )