File: //usr/lib/python3/dist-packages/virtualenv/run/__pycache__/__init__.cpython-310.pyc
o
$�"b� � @ s� d dl mZmZ d dlZd dlZd dlmZ ddlmZ ddl m
Z
ddlmZm
Z
ddlmZ dd lmZ dd
lmZ ddlmZ dd
lmZ ddlmZ ddlmZ d"dd�Zd"dd�Zd#dd�Zd$dd�Zdd� Z dd� Z!dd� Z"dd � Z#d!Z$dS )%� )�absolute_import�unicode_literalsN)�partial� )�
make_app_data)�VirtualEnvConfigParser)�LEVELS�setup_report)�Session)�manual_upgrade)�__version__� )�ActivationSelector)�CreatorSelector)�get_discover)�SeederSelectorTc C sR |du rt jn|}t| |||�}|�
|�� W d � |S 1 s"w Y |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 �9/usr/lib/python3/dist-packages/virtualenv/run/__init__.py�cli_run s
��r c
sf |du rt jn|}t| � ||�\}}|�| �� t� fdd�|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 qd 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�elements�creator�seeder�
activatorsr r r"