Viewing File: /opt/hc_python/lib/python3.12/site-packages/virtualenv/run/__pycache__/__init__.cpython-312.pyc
�
`��gd � �� � d dl mZ d dlZd dlZd dlmZ d dlmZ d dlm Z d dl
mZmZ d dl
mZ d dlmZ d d lmZ d
dlmZ d
dlmZ d
d
lmZ d
dlmZ dd�Zdd�Zdd�Zdd�Zd� Zd� Z d� Z!d� Z"ddgZ#y)� )�annotationsN)�partial)�
make_app_data)�VirtualEnvConfigParser)�LEVELS�setup_report)�Session)�manual_upgrade)�__version__� )�ActivationSelector)�CreatorSelector)�get_discover)�SeederSelectorc � � |�t j n|}t | |||� }|5 |j � ddd� |S # 1 sw Y |S xY w)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_sessions �F/opt/hc_python/lib/python3.12/site-packages/virtualenv/run/__init__.py�cli_runr sG � � ��"�*�*��C� ��w�
�s�C�J� �����
���
���s �A � A
c � �� |�t j n|}t | �||� \ }}|j | � �t �fd�|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)
c 3 �@ �K � | ] }|j �� �� � y �w�N)�create)�.0�er s �r � <genexpr>z"session_via_cli.<locals>.<genexpr>3 s �� �� �'L�8�a�����(9�8�s �) r r �build_parser�
parse_args�tupler � verbosity�app_data�_interpreter) r r r r �parser�elements�creator�seeder�
activatorss ` r r r % s� �� � ��"�*�*��C�#�D�'�=�#�F��F�H�����%�G�"'�'L�8�'L�"L��G�V�Z��������������
� � c �� � t ||�t j n|� }t |� |j ddddd�� t || |� t
| ||� }t |� t || � }|j x|_
}|�d|� �}t |� �t ||� t ||� t ||� g}|j | � \ }} |D ] }
|
j! |� � |j# � ||fS )Nz--with-traceback�with_traceback�
store_trueFz>on failure also display the stacktrace internals of virtualenv)�dest�action�default�helpzfailed to find interpreter for )r r r �add_version_flag�add_argument�_do_report_setup�
load_app_data�handle_extra_commandsr �interpreterr) �RuntimeErrorr r r
�parse_known_args�handle_selected_arg_parse�enable_help)r r r r r* �discoverr<