o
    Wi(                     @  s   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	r2d dlmZ d dlmZ G d	d
 d
ZG dd deeZG dd deeZG dd deeZg dZdS )    )annotations)ABC)OrderedDict)Path)TYPE_CHECKING)IS_WIN)Any)
PythonInfoc                   @  s   e Zd ZdZer
dndZd/d
dZed0ddZed0ddZ	ed0ddZ
ed0ddZed1ddZed0ddZed0ddZed2ddZd3dd Zed4d"d#Zed5d%d&Zed0d'd(Zed5d)d*Zd6d,d-Zd.S )7Describez`Given a host interpreter tell us information about what the created interpreter might look like.z.exe destr   interpreterr	   returnNonec                 C  s(   || _ || _d | _d | _d | _d | _d S N)r   r   _stdlib_stdlib_platform_system_stdlib
_conf_vars)selfr   r    r   N/home/ubuntu/.local/lib/python3.10/site-packages/virtualenv/create/describe.py__init__   s   
zDescribe.__init__c                 C  s   | j S r   )
script_dirr   r   r   r   bin_dir   s   zDescribe.bin_dirc                 C     | j | jd S )Nscriptsr   r   install_pathr   r   r   r   r   !      zDescribe.script_dirc                 C  r   )Npurelibr   r   r   r   r   r!   %   r    zDescribe.purelibc                 C  r   )Nplatlibr   r   r   r   r   r"   )   r    zDescribe.platlib
list[Path]c                 C  s    t t| jd f| jd ff S r   )listr   r"   r!   keysr   r   r   r   libs-   s    zDescribe.libsc                 C  (   | j d u rt| jjd| jd| _ | j S )Nstdlib
config_var)r   r   r   sysconfig_path_config_varsr   r   r   r   r(   1      
zDescribe.stdlibc                 C  r'   )N
platstdlibr)   )r   r   r   r+   r,   r   r   r   r   stdlib_platform7   r-   zDescribe.stdlib_platformdict[str, Any]c                 C  s   | j d u r| | j| _ | j S r   )r   _calc_config_varsr   r   r   r   r   r,   =   s   
zDescribe._config_varstoc                   s     j j} fdd| D S )Nc                   s2   i | ]\}}|t |tr| jjrn|qS r   )
isinstancestr
startswithr   prefix).0kvr   r2   r   r   
<dictcomp>E   s    &z.Describe._calc_config_vars.<locals>.<dictcomp>)r   sysconfig_varsitems)r   r2   sys_varsr   r:   r   r1   C   s   zDescribe._calc_config_varsboolc                 C  s   dS )z.Knows means it knows how the output will look.Tr   clsr   r   r   r   can_describeI      zDescribe.can_describer4   c                 C  s   | j jd S )N)r   partsr   r   r   r   env_nameN   s   zDescribe.env_namec                 C  s   | j |   | j  S r   )r   exe_stemsuffixr   r   r   r   exeR   s   zDescribe.exec                 C  s   t )zcExecutable name without suffix - there seems to be no standard way to get this without creating it.)NotImplementedError)rA   r   r   r   rG   V   rC   zDescribe.exe_stemnamec                 C  s   | j | | j  S r   )r   rH   )r   rK   r   r   r   script[   s   zDescribe.scriptN)r   r   r   r	   r   r   )r   r   )r   r#   )r   r0   )r2   r   r   r0   r   r	   r   r?   )r   r4   )rK   r4   r   r   )__name__
__module____qualname____doc__r   rH   r   propertyr   r   r!   r"   r&   r(   r/   r,   r1   classmethodrB   rF   rI   rG   rL   r   r   r   r   r
      s<    

r
   c                   @  s   e Zd ZdS )Python3SupportsN)rN   rO   rP   r   r   r   r   rT   _   s    rT   c                      "   e Zd Zed fddZ  ZS )PosixSupportsr   r	   r   r?   c                      |j dko
t |S )NposixossuperrB   r@   	__class__r   r   rB   d      zPosixSupports.can_describerM   rN   rO   rP   rS   rB   __classcell__r   r   r\   r   rV   c       rV   c                      rU   )WindowsSupportsr   r	   r   r?   c                   rW   )NntrY   r@   r\   r   r   rB   j   r^   zWindowsSupports.can_describerM   r_   r   r   r\   r   rb   i   ra   rb   )r
   rV   rT   rb   N)
__future__r   abcr   collectionsr   pathlibr   typingr   virtualenv.infor   r   python_discoveryr	   r
   rT   rV   rb   __all__r   r   r   r   <module>   s    O