
    dhW                    v   d Z ddlmZ 	  ed      j	                          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 dd
lmZ ddlmZ ddlmZ  ej6                  e      Z	 	 	 	 	 ddd	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 ddZ	 	 	 	 	 d	 	 	 	 	 	 	 	 	 	 	 	 	 ddZddZ ddZ!ddZ"y# eef$ r Y w xY w)z7Locations where we look for configs, install stuff, etc    )annotations_distutils_hackN)Command)SCHEME_KEYS)installget_python_lib)Scheme)WINDOWS)running_under_virtualenv   )get_major_minor_versionF)ignore_config_filesc                  ddl m} d| i}|rdg|d<    ||      }	|s	 |	j                          d	}|	j                  d
d      }|J |}|r|rJ d| d|        |r|rJ d| d|        |xs |j                  |_	        |s|rd|_
        |xs |j                  |_
        |xs |j                  |_        |xs |j                  |_        |j                          i }t        D ]  }t        |d|z         ||<    d|	j!                  d
      v r(|j#                  |j$                  |j$                  d       t'               r|r|}n|r|j(                  }n|j                  }t*        j,                  j                  |dddt/                |       |d<   |ht*        j,                  j1                  t*        j,                  j3                  |d               d   }t*        j,                  j                  ||dd	       |d<   |S # t        $ r@ |	j	                         }
t
        j                  ddj                  d |
D                     Y w xY w)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  Z   K   | ]#  }t         j                  j                  |       % y w)N)ospathbasename).0ps     d/var/www/html/vivango/api/ia/venv/lib/python3.12/site-packages/pip/_internal/locations/_distutils.py	<genexpr>z#distutils_scheme.<locals>.<genexpr>?   s     =!"''**1-=s   )+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_objuserprefixhomerootfinalize_optionsr   getattrget_option_dictupdater   r   install_userbaser   r   r   
splitdriveabspath)	dist_namer.   r0   r1   isolatedr/   r   r   	dist_argsdpathsobjischemekeypath_no_drives                   r   distutils_schemerC   $   sC    ,-3Y,?I$3#4	- YA	  " $(C


Id

3C??#&A @E$xx"@@ @E$xx"@@ ^QVVAFt!AH^QVVAF^QVVAFF 3ac!12s3 )))44!--AMMJK!F''FXXFGGLL,./0
y GG..rwwvi?P/QRSTUM "T=3D EF9Mm " 	'')ENNH		=u==	s   G; ;AII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    r%   scriptsdata)r!   r    r%   rE   rF   )rC   r
   )r9   r.   r0   r1   r:   r/   r@   s          r   
get_schemerG   t   sL    2 itT8VLFy!y!y!y!F^     c                    t         j                  j                  t        j                        } t
        rat         j                  j                  | d      }t         j                  j                  |      s t         j                  j                  | d      }|S t        j                  d d dk(  r	| d d dk(  ryt         j                  j                  | d      S )NScriptsbin   darwin   z/System/Library/z/usr/local/bin)	r   r   normpathsysr/   r   r,   existsplatform)r/   bin_pys     r   get_bin_prefixrT      s     WWcjj)Ffi0ww~~f%WW\\&%0F ||BQ8#s7I(I77<<&&rH   c                     t        d      S )NFplat_specificr    rH   r   get_purelibrY      s    ..rH   c                     t        d      S )NTrV   r   rX   rH   r   get_platlibr[      s    --rH   )FNNFN)r9   strr.   boolr0   
str | Noner1   r^   r:   r]   r/   r^   r   r]   returnzdict[str, str])r9   r\   r.   r]   r0   r^   r1   r^   r:   r]   r/   r^   r_   r
   )r_   r\   )#__doc__
__future__r   
__import__remove_shimImportErrorAttributeErrorloggingr   rP   distutils.cmdr   DistutilsCommanddistutils.command.installr   r   distutils_install_commanddistutils.sysconfigr	   pip._internal.models.schemer
   pip._internal.utils.compatr   pip._internal.utils.virtualenvr   baser   	getLogger__name__r*   rC   rG   rT   rY   r[   rX   rH   r   <module>rr      sR   = #	 !--/  	 
 5 1 J . . . C )			8	$
 M !&MM
M M 	M
 M M M Md   
    	 
      F'"/.y 	^$ 		s   B. .B87B8