
    |g@                    r   d dl mZ d dlZd dlZd dlZd dlmZ d dlmZm	Z	m
Z
 d dlZddlmZ ddlmZmZ dd	lmZ d dlmc mZ d d
lmZ ej*                  Z G d dej*                        Zej*                  j4                  D  cg c]  } | d    ej6                  vs|  c} ej8                  z   e_        yc c} w )    )annotationsN)Callable)AnyClassVarcast   )Distribution)SetuptoolsDeprecationWarningSetuptoolsWarning   )	bdist_egg)DistutilsArgErrorc                       e Zd ZU dZded<   ej                  j                  ddgz   Zej                  j                  ddgz   Zdd	 fd
d fgZ	ded<    e
e	      Z fdZ fdZd Z fdZed        Zd Z xZS )installz7Use easy_install to install the package, w/dependenciesr	   distribution)old-and-unmanageableNzTry not to use this!)!single-version-externally-managedNz5used by system package builders to create 'flat' eggsr   r   install_egg_infoc                     yNT selfs    W/var/www/html/pythonbot/venv/lib/python3.12/site-packages/setuptools/command/install.py<lambda>zinstall.<lambda>+           install_scriptsc                     yr   r   r   s    r   r   zinstall.<lambda>,   r   r   z8ClassVar[list[tuple[str, Callable[[Any], bool] | None]]]new_commandsc                n    t        j                  ddd       t        |           d | _        d | _        y )Nzsetup.py install is deprecated.z
            Please avoid running ``setup.py`` directly.
            Instead, use pypa/build, pypa/installer or other
            standards-based tools.
            zAhttps://blog.ganssle.io/articles/2021/10/setup-py-deprecated.html)see_url)r
   emitsuperinitialize_optionsold_and_unmanageable!single_version_externally_managedr   	__class__s    r   r%   zinstall.initialize_options0   s<    $))-
 X	
 	"$$(!15.r   c                    t         |           | j                  rd| _        y | j                  r%| j                  s| j                  st        d      y y y )NTzAYou must specify --record or --root when building system packages)r$   finalize_optionsrootr'   recordr   r(   s    r   r+   zinstall.finalize_optionsB   sQ     "9959D23399T[['   &19 4r   c                    | j                   s| j                  rt        j                  j	                  |       S d | _        d| _        y )N )r,   r'   origr   handle_extra_path	path_file
extra_dirsr   s    r   r1   zinstall.handle_extra_pathM   s9    99>><<11$77 r   c                    | j                   s| j                  rt        |          S | j	                  t        j                               st        |           y | j                          y )N)r&   r'   r$   run_called_from_setupinspectcurrentframedo_egg_installr(   s    r   r5   zinstall.runX   sV    $$(N(N7;= &&w';';'=>GKM  !r   c                   | Fd}t        j                  |       t        j                         dk(  rd}t        j                  |       yt	        j
                  |       }|dd D ]f  }|dd \  }t	        j                  |      }|j                  j                  d	d
      }|dk(  r|j                  dk(  rP|dk(  xr |j                  dk(  c S  y)a  
        Attempt to detect whether run() was called from setup() or by another
        command.  If called by setup(), the parent caller will be the
        'run_command' method in 'distutils.dist', and *its* caller will be
        the 'run_commands' method.  If called any other way, the
        immediate caller *might* be 'run_command', but it won't have been
        called by 'run_commands'. Return True in that case or if a call stack
        is unavailable. Return False otherwise.
        Nz4Call stack not available. bdist_* commands may fail.
IronPythonz6For best results, pass -X:Frames to enable call stack.Tr      r   __name__r/   zsetuptools.distrun_commandzdistutils.distrun_commandsF)
r   r#   platformpython_implementationr7   getouterframesgetframeinfo	f_globalsgetfunction)	run_framemsgframesframecallerinfocaller_modules          r   r6   zinstall._called_from_setupe   s     HC""3'--/<?N!&&s+''	2Aa[ 		YEbq	IV''/D",,00R@M 11dmm}6T $44X.9XX		Y r   c                N   | j                   j                  d      } || j                   d| j                  | j                        }|j	                          d|_        |j                  j                  t        j                  d             | j                  d       t        t        | j                   j                  d            }|j                  g}t        j                  r |j!                  dt        j                         ||_        |j%                  d	       d t        _        y )
Neasy_installx)argsr,   r-   .z*.eggr   r   F)show_deprecation)r   get_command_classr,   r-   ensure_finalizedalways_copy_frompackage_indexscanglobr>   r   bdist_egg_clsget_command_obj
egg_output
setuptoolsbootstrap_install_frominsertrQ   r5   )r   rO   cmdr   rQ   s        r   r9   zinstall.do_egg_install   s    ((::>J;;	
 	" 	tyy12%(9(9(I(I+(VW	$$%,,KK:<<=',0
)r   )r=   
__module____qualname____doc____annotations__r0   r   user_optionsboolean_optionsr    dict_ncr%   r+   r1   r5   staticmethodr6   r9   __classcell__)r)   s   @r   r   r      s    A<<,,>	
0 L ll22+6 O 
./	-.NLJ  |
C6$		  @1r   r   )
__future__r   rY   r7   r@   collections.abcr   typingr   r   r   r]   distr	   warningsr
   r   r   rZ   distutils.command.installcommandr   r0   distutils.errorsr   _installsub_commandsrh   r    )r`   s   0r   <module>ru      s    "    $ & &   F 1 ( ( . <<H1dll H1Z <<,,Agkk0IC  s   B4B4