o
    c	                     @   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< defd	d
ZdededefddZdefddZze Zeje ed< W n eyk   ejZY nw e jdddef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   I/opt/certbot/lib/python3.10/site-packages/pip/_internal/locations/base.pyget_major_minor_version   s   r   new_rootpathnamec                 C   s   t jdkrt j|st j| |S t j| |dd S t jdkr=t j|\}}|d dkr6|dd }t j| |S tdt j d)	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   sX   t  rtjtjd} nztjt d} W n ty%   td Y nw 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   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*   
 


