<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0-alpha1/dist/css/bootstrap.min.css" rel="stylesheet"
        integrity="sha384-GLhlTQ8iRABdZLl6O3oVMWSktQOp6b7In1Zl3/Jr59b6EGGoI1aFkw7cmDA6j6gD" crossorigin="anonymous">
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.3.0/css/all.min.css"
        integrity="sha512-SzlrxWUlpfuzQ+pcUCosxcglQRNAq/DZjVsC0lE40xsADsfeQoEypE+enwcOiGjk/bSuGGKHEyjSoQ1zVisanQ=="
        crossorigin="anonymous" referrerpolicy="no-referrer" />
</head>
</html>
B
    a                 @   s   d dl mZmZ d dl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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 ddlmZ ddlmZ d"ddZd#ddZd$ddZd%ddZdd Z dd Z!dd Z"dd  Z#d!Z$dS )&    )absolute_importunicode_literalsN)partial   )make_app_data)VirtualEnvConfigParser)LEVELSsetup_report)Session)manual_upgrade)__version__   )ActivationSelector)CreatorSelector)get_discover)SeederSelectorTc          	   C   s<   |dkrt jn|}t| |||}| |  W dQ R X |S )a  
    Create a virtual environment given some command line interface arguments.

    :param args: the command line arguments
    :param options: passing in a ``VirtualEnvOptions`` object allows return of the parsed options
    :param setup_logging: ``True`` if setup logging handlers, ``False`` to use handlers already registered
    :param env: environment variables to use
    :return: the session object of the creation (its structure for now is experimental and might change on short notice)
    N)osenvironsession_via_clirun)argsoptionssetup_loggingenv
of_session r   H/opt/alt/python37/lib/python3.7/site-packages/virtualenv/run/__init__.pycli_run   s
    
r   c       
         sf   |dkrt jn|}t|  ||\}}||  t fdd|D \}}}t j j|j|||}	|	S )aq  
    Create a virtualenv session (same as cli_run, but this does not perform the creation). Use this if you just want to
    query what the virtual environment would look like, but not actually create it.

    :param args: the command line arguments
    :param options: passing in a ``VirtualEnvOptions`` object allows return of the parsed options
    :param setup_logging: ``True`` if setup logging handlers, ``False`` to use handlers already registered
    :param env: environment variables to use
    :return: the session object of the creation (its structure for now is experimental and might change on short notice)
    Nc             3   s   | ]}|  V  qd S )N)create).0e)r   r   r   	<genexpr>2   s    z"session_via_cli.<locals>.<genexpr>)	r   r   build_parser
parse_argstupler
   	verbosityapp_data_interpreter)
r   r   r   r   parserelementsZcreatorZseederZ
activatorsr   r   )r   r   r   $   s    
r   c       
      C   s   t ||d krtjn|}t| |jdddddd t|| | t| ||}t| t|| }|j	 |_
}|d krtd|t||t||t||g}|| \}}x|D ]}	|	| qW |  ||fS )Nz--with-tracebackwith_traceback
store_trueFz>on failure also display the stacktrace internals of virtualenv)destactiondefaulthelpz!failed to find interpreter for {})r   r   r   add_version_flagadd_argument_do_report_setupload_app_datahandle_extra_commandsr   interpreterr'   RuntimeErrorformatr   r   r   parse_known_argsZhandle_selected_arg_parseZenable_help)
r   r   r   r   r(   discoverr5   r)   _elementr   r   r   r"   7   s.    

r"   c             C   s   t | d S )z/Used to provide a parser for the doc generationr   )r"   )r   r   r   r   build_parser_onlyU   s    r<   c             C   s    | j rt| j| j}t|d S )N)Zupgrade_embed_wheelsr   r&   r   
SystemExit)r   resultr   r   r   r4   Z   s    r4   c          	   C   s   |j dddd |j| |d\}}|j ddtt|j|jdtd |j|jdd	 |j d
ddd |j dddd |j| |d\}}|jr|j  |S )Nz--read-only-app-datar+   zMuse app data folder in read-only mode (write operations will fail with error))r-   r/   )	namespacez
--app-dataz-a data folder used as cache by the virtualenv)Z	read_onlyr   )r/   typer.   z--reset-app-dataz start with empty app data folderz--upgrade-embed-wheelsz.trigger a manual update of the embedded wheels)	r1   r8   r   r   Zread_only_app_datar   Zreset_app_datar&   reset)r   r(   r   r:   r   r   r   r3   `   s,    
r3   c             C   s(   dd l }| jdddt|jdd d S )Nr   z	--versionversionz%(prog)s {} from {}zIdisplay the version of the virtualenv package and its location, then exit)r-   rB   r/   )
virtualenvr1   r7   r   __file__)r(   rC   r   r   r   r0      s    r0   c       	      C   s   d dd ttt D }d}| jd|ttd |d}|	 }|j
dd	d
dddd |j
ddd
dddd | |\}}|rt|j d S )Nz, c             s   s$   | ]\}}d  t||V  qdS )z{}={}N)r7   logginggetLevelName)r   clr   r   r   r!      s    z#_do_report_setup.<locals>.<genexpr>z6verbosity = verbose - quiet, default {}, mapping => {}r%      )titledescriptionz-vz	--verbosecountverbosezincrease verbosityr   )r-   r,   r/   r.   z-qz--quietquietzdecrease verbosityr   )joinsortedlistr   itemsadd_argument_groupr7   rE   rF   add_mutually_exclusive_groupr1   r8   r	   r%   )	r(   r   r   Z	level_mapmsgZverbosity_groupr%   optionr:   r   r   r   r2      s     r2   )r   r   )NTN)NTN)NNTN)N)%
__future__r   r   rE   r   	functoolsr   r&   r   Zconfig.cli.parserr   reportr   r	   Zrun.sessionr
   Zseed.wheels.periodic_updater   rB   r   Zplugin.activatorsr   Zplugin.creatorsr   Zplugin.discoveryr   Zplugin.seedersr   r   r   r"   r<   r4   r3   r0   r2   __all__r   r   r   r   <module>   s,   



