#NEWLINE# def write_dist_info( self , site_pkgs ) : #NEWLINE# #INDENT# 'Write dist-info folder, according to PEP 376' #NEWLINE# metadata = common . make_metadata ( self . module , self . ini_info ) #NEWLINE# dist_info = ( pathlib . Path ( site_pkgs ) / '{}-{}.dist-info' . format ( metadata . name , metadata . version ) ) #NEWLINE# try : #NEWLINE# #INDENT# dist_info . mkdir ( ) #NEWLINE# #UNINDENT# except FileExistsError : #NEWLINE# #INDENT# shutil . rmtree ( str ( dist_info ) ) #NEWLINE# dist_info . mkdir ( ) #NEWLINE# #UNINDENT# with ( dist_info / 'METADATA' ) . open ( 'w' , encoding = 'utf-8' ) as f : #NEWLINE# #INDENT# metadata . write_metadata_file ( f ) #NEWLINE# #UNINDENT# self . installed_files . append ( ( dist_info / 'METADATA' ) ) #NEWLINE# with ( dist_info / 'INSTALLER' ) . open ( 'w' ) as f : #NEWLINE# #INDENT# f . write ( 'flit' ) #NEWLINE# #UNINDENT# self . installed_files . append ( ( dist_info / 'INSTALLER' ) ) #NEWLINE# with ( dist_info / 'REQUESTED' ) . open ( 'w' ) : #NEWLINE# #INDENT# pass #NEWLINE# #UNINDENT# self . installed_files . append ( ( dist_info / 'REQUESTED' ) ) #NEWLINE# if ( self . ini_info [ 'entry_points_file' ] is not None ) : #NEWLINE# #INDENT# shutil . copy ( str ( self . ini_info [ 'entry_points_file' ] ) , str ( ( dist_info / 'entry_points.txt' ) ) ) #NEWLINE# self . installed_files . append ( ( dist_info / 'entry_points.txt' ) ) #NEWLINE# #UNINDENT# with ( dist_info / 'RECORD' ) . open ( 'w' , encoding = 'utf-8' ) as f : #NEWLINE# #INDENT# cf = csv . writer ( f ) #NEWLINE# for path in self . installed_files : #NEWLINE# #INDENT# path = pathlib . Path ( path ) #NEWLINE# if ( path . is_symlink ( ) or ( path . suffix in { '.pyc' , '.pyo' } ) ) : #NEWLINE# #INDENT# ( hash , size ) = ( '' , '' ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# hash = ( 'sha256=' + common . hash_file ( path ) ) #NEWLINE# size = path . stat ( ) . st_size #NEWLINE# #UNINDENT# try : #NEWLINE# #INDENT# path = path . relative_to ( site_pkgs ) #NEWLINE# #UNINDENT# except ValueError : #NEWLINE# #INDENT# pass #NEWLINE# #UNINDENT# cf . writerow ( ( path , hash , size ) ) #NEWLINE# #UNINDENT# cf . writerow ( ( ( dist_info / 'RECORD' ) . relative_to ( size ) , '' , '' ) )