
    f	                    t    d dl mZ d dlmZ d dlmc mZ d dlZd dl	Z	ddl
mZ  G d dej                        Zy)    )annotations)logN   )ensure_directoryc                  ,    e Zd ZdZd ZddZd ZddZy)	install_scriptsz;Do normal script install, plus any egg_info wrapper scriptsc                P    t         j                  j                  |        d| _        y )NF)origr   initialize_optionsno_epselfs    V/app/.heroku/python/lib/python3.12/site-packages/setuptools/command/install_scripts.pyr   z"install_scripts.initialize_options   s    //5
    c                    | j                  d       | j                  j                  r t        j                  j                  |        ng | _        | j                  ry | j                          y )Negg_info)	run_commanddistributionscriptsr
   r   runoutfilesr   _install_ep_scriptsr   s    r   r   zinstall_scripts.run   sP    $$$  $$T*')DM::  "r   c                $   ddl m}m} ddlm} | j                  d      } ||j                   ||j                  |j                        |j                  |j                        }| j                  d      }t        |dd       }|j                  }|t        j                  k(  r|g}|j                         }|j                  j                         j!                  |      }	|j#                  ||	j%                               D ]  }
 | j&                  |
   y )Nr   )DistributionPathMetadata   )easy_installr   build_scripts
executable)pkg_resourcesr   r    r   get_finalized_commandegg_baser   egg_nameegg_versiongetattrScriptWritersysr   bestcommand_spec_class
from_paramget_args	as_headerwrite_script)r   r   r   eiei_cmddistbs_cmd
exec_paramwritercmdargss              r   r   z#install_scripts._install_ep_scripts   s    <(++J7OO&//:OO	
 ++O<V\48
' %J'',,.99*EOOD#--/:DDt$ ;r   c                   ddl m}m} t        j                  d|| j
                         t        j                  j                  | j
                  |      }| j                  j                  |       d|v rdnd} |       }	| j                  sCt        |       t        |d|z   |      5 }
|
j                  |       ddd        ||d	|	z
         yy# 1 sw Y   xY w)
z1Write an executable file to the scripts directoryr   )chmodcurrent_umaskzInstalling %s script to %sbNzutf-8w)encodingi  )setuptools.command.easy_installr8   r9   r   infoinstall_dirospathjoinr   appenddry_runr   openwrite)r   script_namecontentsmodeignoredr8   r9   targetr<   maskfs              r   r.   zinstall_scripts.write_script6   s    H-{D<L<LMd..<V$$;4G||V$fcDj8< "!"&%$,'	 " "s   &CCN)returnNone)t)__name__
__module____qualname____doc__r   r   r   r.    r   r   r   r      s    E	#%2(r   r   )
__future__r   	distutilsr   !distutils.command.install_scriptscommandr   r
   r@   r(   _pathr   rU   r   r   <module>r[      s,    "  0 0 	 
 $9(d** 9(r   