
    e                        d Z 	  ed                                           n# eef$ r Y nw xY wddlZddlZddlZddlm	Z
 ddlmZ ddlmZ ddlmZ ddlmZmZmZmZmZ dd	lmZ dd
lmZ ddlmZ ddlmZ  ej        e           Z!	 	 	 	 	 dddde"de#dee"         dee"         de#dee"         de#dee"e"f         fdZ$	 	 	 	 	 dde"de#dee"         dee"         de#dee"         defdZ%de"fdZ&de"fdZ'de"fdZ(dS )z7Locations where we look for configs, install stuff, etc_distutils_hack    N)Command)SCHEME_KEYS)installget_python_lib)DictListOptionalUnioncast)Scheme)WINDOWS)running_under_virtualenv   )get_major_minor_versionF)ignore_config_files	dist_nameuserhomerootisolatedprefixr   returnc                   ddl m} d| i}|rdg|d<    ||          }	|sr	 |	                                 n\# t          $ rO |	                                }
t
                              dd                    d |
D                                  Y nw xY wd	}|	                    d
d          }|J t          t          |          }|r|rJ d| d|             |r|rJ d| d|             |p|j        |_        |s|rd|_        |p|j        |_        |p|j        |_        |p|j        |_        |                                 i }t           D ]}t#          |d|z             ||<   d|	                    d
          v r.|                    t)          |j        |j                             t-                      r|r|}n|r|j        }n|j        }t0          j                            |dddt5                       |           |d<   |st0          j                            t0          j                            |d                             d         }t0          j                            ||dd	                   |d<   |S )z+
    Return a distutils install scheme
    r   )Distributionnamez--no-user-cfgscript_argsz6Ignore distutils configs in %s due to encoding errors.z, c              3   T   K   | ]#}t           j                            |          V  $d S )N)ospathbasename).0ps     Y/var/www/html/api/venv/lib/python3.11/site-packages/pip/_internal/locations/_distutils.py	<genexpr>z#distutils_scheme.<locals>.<genexpr>?   s2      ==!"'**1--======    Nr   T)createzuser=z prefix=zhome= install_install_lib)purelibplatlibincludesitepythonheadersr   )distutils.distr   parse_config_filesUnicodeDecodeErrorfind_config_filesloggerwarningjoinget_command_objr   distutils_install_commandr   r   r   r   finalize_optionsr   getattrget_option_dictupdatedictr+   r   install_userbaser    r!   r   
splitdriveabspath)r   r   r   r   r   r   r   r   	dist_argsdpathsobjischemekeypath_no_drives                   r%   distutils_schemerK   #   s    ,+++++3992EI 5$3#4	- YA 		  """"! 	 	 	''))ENNH		==u=====    	 '+C


Id

3
3C???&,,A @@@"@$"@"@"@"@@@@@@@"@$"@"@"@"@@@@^QVAF t !AH^QVAF^QVAFF 3 3ac!122s )))4444d1=!-HHHIII!! F 	FF 	'FFXFGLL0,..00
 
y G..rwvi?P/Q/QRRSTUM "T=3D E EF9Ms   6 ABBc                     t          | |||||          }t          |d         |d         |d         |d         |d                   S )a;  
    Get the "scheme" corresponding to the input parameters. The distutils
    documentation provides the context for the available schemes:
    https://docs.python.org/3/install/index.html#alternate-installation

    :param dist_name: the name of the package to retrieve the scheme for, used
        in the headers scheme path
    :param user: indicates to use the "user" scheme
    :param home: indicates to use the "home" scheme and provides the base
        directory for the same
    :param root: root under which other directories are re-based
    :param isolated: equivalent to --no-user-cfg, i.e. do not consider
        ~/.pydistutils.cfg (posix) or ~/pydistutils.cfg (non-posix) for
        scheme paths
    :param prefix: indicates to use the "prefix" scheme and provides the
        base directory for the same
    r-   r,   r1   scriptsdata)r-   r,   r1   rM   rN   )rK   r   )r   r   r   r   r   r   rH   s          r%   
get_schemerO   t   sY    2 itT8VLLFy!y!y!y!F^   r'   c                     t           j                            t          j                  } t
          rat           j                            | d          }t           j                            |          s t           j                            | d          }|S t          j        d d         dk    r| d d         dk    rdS t           j                            | d          S )NScriptsbin   darwin   z/System/Library/z/usr/local/bin)	r    r!   normpathsysr   r   r8   existsplatform)r   bin_pys     r%   get_bin_prefixr[      s     Wcj))F fi00w~~f%% 	1W\\&%00F |BQB8##ss7I(I(I7<<&&&r'   c                  "    t          d          S )NFplat_specificr    r'   r%   get_purelibr`      s    ....r'   c                  "    t          d          S )NTr]   r   r_   r'   r%   get_platlibrb      s    ----r'   )FNNFN))__doc__
__import__remove_shimImportErrorAttributeErrorloggingr    rW   distutils.cmdr   DistutilsCommanddistutils.command.installr   r   r:   distutils.sysconfigr   typingr	   r
   r   r   r   pip._internal.models.schemer   pip._internal.utils.compatr   pip._internal.utils.virtualenvr   baser   	getLogger__name__r6   strboolrK   rO   r[   r`   rb   r_   r'   r%   <module>rv      s   = =	J !!--////^$ 	 	 	D	  				 



 5 5 5 5 5 5 1 1 1 1 1 1 J J J J J J . . . . . . 4 4 4 4 4 4 4 4 4 4 4 4 4 4 . . . . . . . . . . . . C C C C C C ) ) ) ) ) )		8	$	$
  N !&N N NN
N 3-N 3-	N
 N SMN N 
#s(^N N N Nf      
  3-  3-	 
   SM         F' ' ' ' '"/S / / / /.S . . . . . .s   " ,,