
    3i
                        d Z ddlmZ ddl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mZmZ dd
lmZmZ ddlmZ 	 	 	 d	 	 	 	 	 	 	 	 	 	 	 ddZ G d de
      ZddgZy)z<Virtualenv-specific Builtin discovery wrapping py_discovery.    )annotationsN)TYPE_CHECKING)get_interpreter   )Discover)ArgumentParser)IterableMappingSequence)PyInfoCache
PythonInfo)VirtualEnvOptionsc                &    t        | ||xs ||      S )N)_get_interpreter)keytry_first_withcacheenvapp_datas        O/var/www/opsc/venv/lib/python3.12/site-packages/virtualenv/discovery/builtin.pyr   r      s     C1B(CHH    c                  b     e Zd ZU ded<   ded<   ded<   d
 fdZedd       ZddZdd	Z xZ	S )BuiltinzSequence[str]python_specr   r   r   c                .   t         |   |       |j                  xs t        j                  g| _        | j                  j                  d      r$| j
                  dd  | j
                  d d z   | _        |j                  | _        |j                  | _	        y )NVIRTUALENV_PYTHONr   )
super__init__pythonsys
executabler   _envgetr   r   )selfoptions	__class__s     r   r   zBuiltin.__init__$   s{    !">>=cnn-=99==,-#//3d6F6Fr6JJD((%44r   c           
     v    |j                  ddddt        dg d       |j                  dd	d
t        dg d       y )Nz-pz--pythonr   pyappendzinterpreter based on what to create environment (path/identifier/version-specifier) - by default use the interpreter where the tool is installed - first found wins. Version specifiers (e.g., >=3.12, ~=3.11.0, ==3.10) are also supported)destmetavartypeactiondefaulthelpz--try-first-withr   py_exez:try first these interpreters before starting the discovery)add_argumentstr)clsparsers     r   add_parser_argumentszBuiltin.add_parser_arguments,   sZ    U 	 	
 	!M 	 	
r   c                    | j                   D ]5  }t        || j                  | j                  | j                        x}s3|c S  y )N)r   r   )r   r   r   r   r"   )r$   r   results      r   runzBuiltin.runD   sQ    ++ 	K(##II	 v  	 r   c                    t        | j                        dk(  r| j                  d   n| j                  }| j                  j                   d|S )Nr   r   z discover of python_spec=)lenr   r&   __name__)r$   specs     r   __repr__zBuiltin.__repr__O   sI    &)$*:*:&;q&@t"dFVFV..))**CD8LLr   )r%   r   returnNone)r4   r   r>   r?   )r>   PythonInfo | None)r>   r2   )
r;   
__module____qualname____annotations__r   classmethodr5   r8   r=   __classcell__)r&   s   @r   r   r      s9    !!5 
 
.	Mr   r   r   )NNN)r   r2   r   zIterable[str]r   PyInfoCache | Noner   zMapping[str, str] | Noner   rF   r>   r@   )__doc__
__future__r   r    typingr   python_discoveryr   r   discoverr   argparser   collections.abcr	   r
   r   r   r   virtualenv.config.cli.parserr   r   __all__ r   r   <module>rQ      s    B " 
   @ ';;8> !%$(#'I	I!I I 
"	I
 !I I2Mh 2Ml r   