U
    +|j\  ã                   @   sÌ   d 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mZ ddlmZ dd	lmZ dd
lmZ ddlmZ ddd„Zddd„Zdd„ Zdd„ Zdd„ Zdd„ Z dS )z7Locations where we look for configs, install stuff, etcé    N)ÚCommand)ÚSCHEME_KEYS)Úinstall©Úget_python_lib)ÚDictÚListÚOptionalÚTupleÚUnionÚcast)ÚScheme)ÚWINDOWS)Úrunning_under_virtualenvé   )Úget_major_minor_versionFc                 C   sŒ  ddl m} d| i}|r"dg|d< ||ƒ}| ¡  d}	|jddd	�}	|	dk	sPt‚tt|	ƒ}
|rv|rvtd
|› d|› �ƒ‚|r’|r’td|› d|› �ƒ‚|pš|
j|
_|s¦|r¬d|
_|p´|
j|
_|pÀ|
j	|
_	|pÌ|
j
|
_
|
 ¡  i }tD ]}t|
d| ƒ||< qàd| d¡k�r| t|
j|
jd�¡ tƒ �rˆtj |
jdddtƒ › �| ¡|d< |dk	�rˆtj tj |d ¡¡d }tj ||dd… ¡|d< |S )z+
    Return a distutils install scheme
    r   )ÚDistributionÚnamez--no-user-cfgÚscript_argsNr   T)Úcreatezuser=z prefix=zhome=Ú Úinstall_Úinstall_lib)ÚpurelibÚplatlibÚincludeÚsiteÚpythonÚheadersr   )Údistutils.distr   Úparse_config_filesÚget_command_objÚAssertionErrorr   Údistutils_install_commandÚuserÚprefixÚhomeÚrootÚfinalize_optionsr   ÚgetattrÚget_option_dictÚupdateÚdictr   r   ÚosÚpathÚjoinr   Ú
splitdriveÚabspath)Ú	dist_namer$   r&   r'   Úisolatedr%   r   Ú	dist_argsÚdÚobjÚiÚschemeÚkeyÚpath_no_drive© r;   újC:\Users\snmko\Desktop\web_content\django_cbt\venv\Lib\site-packages\pip/_internal/locations/_distutils.pyÚ_distutils_scheme   sN    


û

þr=   c                 C   s8   t | |||||ƒ}t|d |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   r>   r?   )r=   r   )r2   r$   r&   r'   r3   r%   r8   r;   r;   r<   Ú
get_schemeT   s    ûr@   c                  C   sl   t r4tj tjd¡} tj | ¡s0tj tjd¡} | S tjd d… dkr\tjd d… dkr\dS tj tjd¡S )NÚScriptsÚbiné   Údarwiné   z/System/Library/z/usr/local/bin)r   r-   r.   r/   Úsysr%   ÚexistsÚplatform)Úbin_pyr;   r;   r<   Úget_bin_prefixx   s    $rJ   c                   C   s
   t dd�S )NF©Úplat_specificr   r;   r;   r;   r<   Úget_purelib‡   s    rM   c                   C   s
   t dd�S )NTrK   r   r;   r;   r;   r<   Úget_platlibŒ   s    rN   c                 C   s   t d| d�t d| d�fS )NF)rL   r%   Tr   )r%   r;   r;   r<   Úget_prefixed_libs‘   s    

þrO   )FNNFN)FNNFN)!Ú__doc__r-   rF   Údistutils.cmdr   ÚDistutilsCommandÚdistutils.command.installr   r   r#   Údistutils.sysconfigr   Útypingr   r   r	   r
   r   r   Úpip._internal.models.schemer   Úpip._internal.utils.compatr   Úpip._internal.utils.virtualenvr   Úbaser   r=   r@   rJ   rM   rN   rO   r;   r;   r;   r<   Ú<module>   s6             ÿ
A     ú
$