
    lf                    f   d dl mZ d dlmZ d dlmZ d dlZd dlZd dlZd dl	m
c mZ d dlmZmZmZ d dlZddlmZmZ dd	lmZ ej                  Z G d
 dej                        Zej                  j0                  D  cg c]  } | d    ej2                  vs|  c} ej4                  z   e_        yc c} w )    )annotations)Callable)DistutilsArgErrorN)AnyClassVarcast   )SetuptoolsDeprecationWarningSetuptoolsWarning   )	bdist_eggc                       e Zd ZU dZ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/dependencies)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    r/var/dept/share/cheung/public_html/OutSchool/python/env/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_options+   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_options=   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   r/   zinstall.handle_extra_pathH   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   r3   zinstall.runS   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_implementationr5   getouterframesgetframeinfo	f_globalsgetfunction)	run_framemsgframesframecallerinfocaller_modules          r   r4   zinstall._called_from_setup`   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)distribution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insertrO   r3   )r   rM   cmdr   rO   s        r   r7   zinstall.do_egg_install   s    ((::>J;;	
 	" 	tyy12%(9(9(I(I+(VW	$$%,,KK:<<=',0
)r   )r;   
__module____qualname____doc__r.   r   user_optionsboolean_optionsr   __annotations__dict_ncr#   r)   r/   r3   staticmethodr4   r7   __classcell__)r'   s   @r   r   r      s    A<<,,>	
0 L ll22+6 O 
./	-.NLJ  |
C6$		  @1r   r   )
__future__r   collections.abcr   distutils.errorsr   r5   rX   r>   distutils.command.installcommandr   r.   typingr   r   r   r\   warningsr
   r   r   rY   _installsub_commandsrg   r   )r_   s   0r   <module>rs      s    " $ .    ( ( & &  F 1 <<F1dll F1V <<,,Agkk0IC  s   =B.B.