o
    Wi                     @  s   d dl m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 e
rHd d	lmZ d d
lmZ d dlmZ d dlmZ eeZdZG dd deeZdgZdS )    )annotationsN)ABC)SUPPRESS)Path)TYPE_CHECKING)Seeder)Version)ArgumentParser)
PythonInfo)AppData)VirtualEnvOptionsTc                      sN   e Zd Zd fddZeddd	Zdd
dZedddZdddZ  Z	S )	BaseEmbedoptionsr   returnNonec                   s   t  j||jdu d |j| _dd |jD | _|j| _|j| _|j	p$d| _
|j| _|j| _|j| _|j| _|j | _|jd d dkrT|j	d usL|jrQtd d	| _|  s]d| _d S d S )
NF)enabledc                 S  s   g | ]
}|  r| qS  )existsresolve.0ir   r   T/home/ubuntu/.local/lib/python3.10/site-packages/virtualenv/seed/embed/base_embed.py
<listcomp>   s    z&BaseEmbed.__init__.<locals>.<listcomp>none      	   zThe --no-wheel and --wheel options are deprecated. They have no effect for Python > 3.8 as wheel is no longer bundled in virtualenv.T)super__init__no_seeddownloadextra_search_dirpippip_version
setuptoolssetuptools_versionwheelwheel_versionno_pipno_setuptoolsno_wheelapp_datano_periodic_updateperiodic_update
py_versionLOGGERwarningdistribution_to_versionsr   )selfr   	__class__r   r   r       s(   

zBaseEmbed.__init__dict[str, str]c                 C  s   t jt jt jdS )N)r$   r&   r(   )r   bundle)clsr   r   r   distributions9   s   zBaseEmbed.distributionsc                   s    fdd   D S )Nc                   sH   i | ] }t  d | ddu rt  | ddkr|t  | dqS )no_NF_versionr   )getattr)r   distributionr4   r   r   
<dictcomp>B   s
    *z6BaseEmbed.distribution_to_versions.<locals>.<dictcomp>)r:   r?   r   r?   r   r3   A   s   
z"BaseEmbed.distribution_to_versionsparserr	   interpreterr
   r-   r   c              
   C  sX  |  }|jdddddd|   ddd	 |jd
dddd|   ddd	 |jddtddg d |   D ]7\}}d| d}|jd d dkrU|dv rUd}|jd d dkrf|dkrfd }t}|jd| |d||d q<|  D ]&}d| }|jd d dkr|dkrt}|jd| d | d|dd	 qx|jd!d"dd#t d	 d S )$Nz--no-downloadz--never-downloadr"   store_falsez'pass to disable download of the latest /z
 from PyPIT)destactionhelpdefaultz
--download
store_truez&pass to enable download of the latest Fz--extra-search-dird+zPa path containing wheels to extend the internal wheel list (can be set 1+ times))metavartypenargsrG   rH   zversion of z9 to install as seed: embed, bundle, none or exact versionr   )r      >   r(   r&   r   r   r(   z--version)rE   rL   rG   rH   zdo not install z--no-r;   z--no-periodic-updater.   zGdisable the periodic (once every 14 days) update of the embedded wheels)	add_mutually_exclusive_groupadd_argumentjoinr:   r   itemsversion_infor   PERIODIC_UPDATE_ON_BY_DEFAULT)r9   rA   rB   r-   groupr>   rH   help_r   r   r   add_parser_argumentsH   sp   

zBaseEmbed.add_parser_argumentsstrc                 C  s   | j j}|d7 }| jr|dddd | jD  d7 }|d| j d7 }|  D ]+}t| d| d r5q)t| | d	d }|d
krCq)d|pGd }|d| | d7 }q)|d d d S )N(zextra_search_dir=z, c                 s  s    | ]}t |V  qd S )N)rZ   r   r   r   r   	<genexpr>   s    z%BaseEmbed.__repr__.<locals>.<genexpr>,z	download=r;   r<   r   =latest ))r6   __name__r#   rS   r"   r:   r=   )r4   resultr>   rP   verr   r   r   __repr__   s   "zBaseEmbed.__repr__)r   r   r   r   )r   r7   )rA   r	   rB   r
   r-   r   r   r   )r   rZ   )
rc   
__module____qualname__r    classmethodr:   r3   rY   rf   __classcell__r   r   r5   r   r      s     
:r   )
__future__r   loggingabcr   argparser   pathlibr   typingr   virtualenv.seed.seederr   virtualenv.seed.wheelsr   r	   python_discoveryr
   virtualenv.app_data.baser   virtualenv.config.cli.parserr   	getLoggerrc   r1   rV   r   __all__r   r   r   r   <module>   s$    
}