o
    1Bi                     @   s   d dl mZ d dlZd dlZd dlZd dlm  mZ d dl	m
Z
 d dlZddlmZmZ ddlmZ ejZG dd	 d	ejZd
d ejjD ej e_dS )    )DistutilsArgErrorN)cast   )SetuptoolsDeprecationWarningSetuptoolsWarning   )	bdist_eggc                   @   s   e Zd ZdZejjddg Zejjddg Zddd fd	d
d fgZe	eZ
dd Zdd Zdd Zdd Zedd Zdd Zd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                 C      dS NT selfr   r   Z/var/www/html/Trade-python/venv/lib/python3.10/site-packages/setuptools/command/install.py<lambda>!       zinstall.<lambda>install_scriptsc                 C   r   r   r   r   r   r   r   r   "   r   c                 C   s,   t jdddd tj|  d | _d | _d S )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origr	   initialize_optionsold_and_unmanageable!single_version_externally_managedr   r   r   r   r   &   s   
zinstall.initialize_optionsc                 C   sB   t j|  | jrd| _d S | jr| js| jstdd S d S d S )NTzAYou must specify --record or --root when building system packages)r   r	   finalize_optionsrootr   recordr   r   r   r   r   r   8   s   
zinstall.finalize_optionsc                 C   s(   | j s| jrtj| S d | _d| _d S )N )r   r   r   r	   handle_extra_path	path_file
extra_dirsr   r   r   r   r    C   s
   zinstall.handle_extra_pathc                 C   sB   | j s| jrtj| S | t stj|  d S |   d S )N)	r   r   r   r	   run_called_from_setupinspectcurrentframedo_egg_installr   r   r   r   r#   N   s   zinstall.runc                 C   s   | du rd}t | t dkrd}t | dS t| }|dd D ])}|dd \}t|}|jd	d
}|dkrD|j	dkrDq%|dkoL|j	dk  S dS )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_implementationr%   getouterframesgetframeinfo	f_globalsgetfunction)	run_framemsgframesframecallerinfocaller_moduler   r   r   r$   [   s    



zinstall._called_from_setupc                 C   s   | j d}|| j d| j| jd}|  d|_|jtd | 	d t
t| j d}|jg}tjr=|dtj ||_|jdd	 d t_d S )
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insertr=   r#   )r   r;   cmdr   r=   r   r   r   r'   |   s$   

zinstall.do_egg_installN)r*   
__module____qualname____doc__r   r	   user_optionsboolean_optionsnew_commandsdict_ncr   r   r    r#   staticmethodr$   r'   r   r   r   r   r	      s*    


 r	   c                 C   s   g | ]}|d  t jvr|qS )r   )r	   rU   ).0rM   r   r   r   
<listcomp>   s    rX   )distutils.errorsr   r%   rF   r-   distutils.command.installcommandr	   r   typingr   rJ   warningsr   r   r   rG   _installsub_commandsrS   r   r   r   r   <module>   s"     	
