
    3i                        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
rd d	lmZ d d
lmZ d dlmZ d dlmZ  ej,                  e      ZdZ G d dee      ZdgZy)    )annotationsN)ABC)SUPPRESS)Path)TYPE_CHECKING)Seeder)Version)ArgumentParser)
PythonInfo)AppData)VirtualEnvOptionsTc                  T     e Zd Zd fdZedd       ZddZedd       Zd	dZ xZ	S )
	BaseEmbedc                   t         |   ||j                  du        |j                  | _        |j                  D cg c]#  }|j                         s|j                         % c}| _        |j                  | _        |j                  | _
        |j                  xs d| _        |j                  | _        |j                  | _        |j                  | _        |j                   | _        |j"                   | _        |j&                  d d dk\  r4|j                  |j                  rt(        j+                  d       d| _        | j-                         sd| _        y y c c}w )NF)enabled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existsresolve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   )selfoptionsi	__class__s      S/var/www/opsc/venv/lib/python3.12/site-packages/virtualenv/seed/embed/base_embed.pyr   zBaseEmbed.__init__   s&   '//U*BC((6=6N6N ]RSRZRZR\ ]";;")"4"4
 %]]4fnn$22((((#*#=#==bq!V+}}(G,<,<-
 !DM,,. DL /3 !^s   EEc                b    t         j                  t         j                  t         j                  dS )N)r   r    r"   )r	   bundle)clss    r2   distributionszBaseEmbed.distributions9   s#     >>!..^^
 	
    c           	         | j                         D ci c]6  }t        | d| d       du r"t        | | d      dk7  r|t        | | d      8 c}S c c}w )Nno_F_versionr   )r6   getattr)r.   distributions     r2   r-   z"BaseEmbed.distribution_to_versionsA   sq     !% 2 2 4
ts<.148EAgdWcVddlTmFnrxFx '$<.(ABB
 	
 
s   ;Ac                   |j                         }|j                  ddddddj                  | j                                dd	       |j                  d
ddddj                  | j                                dd	       |j                  ddt        ddg        | j                         j                         D ][  \  }}d| d}|j                  d d dk\  r|dv rd}|j                  d d dk\  r|dk(  rd }t        }|j                  d| |d||       ] | j                         D ]@  }d| }|j                  d d dk\  r|dk(  rt        }|j                  d| d | d|d	       B |j                  d!d"dd#t         	       y )$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nargsrB   rC   zversion of z9 to install as seed: embed, bundle, none or exact versionr   )r      >   r"   r    r   r   r"   z--version)r@   rG   rB   rC   zdo not install z--no-r9   z--no-periodic-updater(   zGdisable the periodic (once every 14 days) update of the embedded wheels)	add_mutually_exclusive_groupadd_argumentjoinr6   r   itemsversion_infor   PERIODIC_UPDATE_ON_BY_DEFAULT)r5   parserinterpreterr'   groupr<   rC   help_s           r2   add_parser_argumentszBaseEmbed.add_parser_argumentsH   s    335 :388CDUDUDW;X:YYcd 	 	
 	9#((3CTCTCV:W9XXbc 	 	
 	 c 	 	
 &)%6%6%8%>%>%@ 	!L'!,/hiE''+w6<Kb;b ''+v5,':Q \N#!!   	  --/ 
	L%l^4E''+v5,':Q ~&<.)#   	
	 	"%Z55 	 	
r7   c                x   | j                   j                  }|dz  }| j                  r)|ddj                  d | j                  D               dz  }|d| j                   dz  }| j                         D ]=  }t        | d| d       rt        | | dd       }|d	k(  r*d
|xs d }|d| | dz  }? |d d dz   S )N(zextra_search_dir=z, c              3  2   K   | ]  }t        |        y w)N)str).0r0   s     r2   	<genexpr>z%BaseEmbed.__repr__.<locals>.<genexpr>   s     3ZqCF3Zs   ,z	download=r9   r:   r   =latest ))r1   __name__r   rN   r   r6   r;   )r.   resultr<   rK   vers        r2   __repr__zBaseEmbed.__repr__   s    ((#  )$))3ZDDYDY3Z*Z)[[\]]FIdmm_A.. ..0 	/Lts<.148d|nH$=tDG& g)*+C,uA..F	/ cr{S  r7   )r/   r   returnNone)rg   zdict[str, str])rR   r
   rS   r   r'   r   rg   rh   )rg   rZ   )
rc   
__module____qualname__r   classmethodr6   r-   rV   rf   __classcell__)r1   s   @r2   r   r      s<    !@ 
 

 8
 8
t!r7   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   r+   rQ   r   __all__ r7   r2   <module>r{      sa    "       ) *'+0>			8	$ $ y! y!z r7   