U
    „~$hü	  ã                   @   sô   U d dl Z d dlZd dlZ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 e	 d¡Ze d¡Zeed< edœd	d
„Zeeedœdd„Zedœdd„Zze ¡ Zeje ed< W n ek
rÔ   ejZY nX e jdd�edœdd„ƒZdS )é    N)ÚInstallationError)Úappdirs)Úrunning_under_virtualenvÚpipÚpurelibÚsite_packages)Úreturnc                   C   s   dj tjŽ S )ze
    Return the major-minor version of the current Python as a string, e.g.
    "3.7" or "3.10".
    z{}.{})ÚformatÚsysÚversion_info© r   r   ú@/tmp/pip-unpacked-wheel-g27rp152/pip/_internal/locations/base.pyÚget_major_minor_version   s    r   )Únew_rootÚpathnamer   c                 C   s’   t jdkr<t j |¡s$t j | |¡S t j | |dd… ¡S nRt jdkr|t j |¡\}}|d dkrn|dd… }t j | |¡S tdt j› d�ƒ‚dS )	aQ  Return 'pathname' with 'new_root' prepended.

    If 'pathname' is relative, this is equivalent to os.path.join(new_root, pathname).
    Otherwise, it requires making 'pathname' relative and then joining the
    two, which is tricky on DOS/Windows and Mac OS.

    This is borrowed from Python's standard library's distutils module.
    Úposixé   NÚntr   ú\zUnknown platform: z5
Can not change root path prefix on unknown platform.)ÚosÚnameÚpathÚisabsÚjoinÚ
splitdriver   )r   r   Údriver   r   r   r   Úchange_root   s    	

ÿr   c                  C   sZ   t ƒ rtj tjd¡} n6ztj t ¡ d¡} W n tk
rL   t d¡ Y nX tj 	| ¡S )NÚsrcz=The folder you are executing pip from can no longer be found.)
r   r   r   r   r
   ÚprefixÚgetcwdÚOSErrorÚexitÚabspath)Ú
src_prefixr   r   r   Úget_src_prefix7   s    r$   Ú	user_site)Úmaxsizec                   C   s   t t d¡ƒS )NÚPYTHONFRAMEWORK)ÚboolÚ	sysconfigÚget_config_varr   r   r   r   Úis_osx_frameworkO   s    r+   )Ú	functoolsr   Úsiter
   r)   ÚtypingÚpip._internal.exceptionsr   Zpip._internal.utilsr   Úpip._internal.utils.virtualenvr   Úuser_cache_dirÚUSER_CACHE_DIRÚget_pathr   ÚstrÚ__annotations__r   r   r$   Úgetusersitepackagesr%   ÚOptionalÚAttributeErrorÚ	USER_SITEÚ	lru_cacher(   r+   r   r   r   r   Ú<module>   s(    

