Viewing File: /opt/hc_python/lib/python3.12/site-packages/virtualenv/run/__pycache__/__init__.cpython-312.pyc

�

`��gd����ddlmZddlZddlZddlmZddlmZddlm	Z	ddl
mZmZddl
mZddlmZdd	lmZd
dlmZd
dlmZd
d
lmZd
dlmZdd�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��|�tjn|}t||||�}|5|j�ddd�|S#1swY|SxYw)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_runrsG����"�*�*��C� ��w�
�s�C�J�	�����
���
���s�A�A
c���|�tjn|}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)
    c3�@�K�|]}|j�����y�w�N)�create)�.0�ers  �r�	<genexpr>z"session_via_cli.<locals>.<genexpr>3s�����'L�8�a�����(9�8�s�)	rr�build_parser�
parse_args�tupler	�	verbosity�app_data�_interpreter)	rrrr�parser�elements�creator�seeder�
activatorss	 `       rrr%s������"�*�*��C�#�D�'�=�#�F��F�H�����%�G�"'�'L�8�'L�"L��G�V�Z��������������
��c���t||�tjn|�}t|�|j	ddddd��t|||�t
|||�}t|�t||�}|jx|_
}|�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 )rrr�add_version_flag�add_argument�_do_report_setup�
load_app_data�handle_extra_commandsr�interpreterr)�RuntimeErrorrrr
�parse_known_args�handle_selected_arg_parse�enable_help)rrrrr*�discoverr<�msgr+�_�elements           rr$r$>s��
#�G�3�;�R�Z�Z�C�
P�F��V��
����
���
M����V�T�=�1��D�&�'�2�G��'�"��F�D�)�H�(0�(<�(<�<�F��+���/��z�:���3�����V�,��{�F�+��;��/��H�
�(�(��.�J�G�Q����)�)�'�2��
�����8��r/c��t|�dS)z0Used to provide a parser for the doc generation.r)r$)rs r�build_parser_onlyrF]s�����a� � r/c�r�|jr+t|j|j�}t	|��yr)�upgrade_embed_wheelsr
r(r�
SystemExit)r�results  rr;r;bs1���#�#��� 0� 0�'�+�+�>���� � �$r/c
���|jddd��|j||��\}}|jddtt|j|j
��td|j|j
���	�|jd
dd��|jddd
��|j||��\}}|jr|jj�|S)Nz--read-only-app-datar2zMuse app data folder in read-only mode (write operations will fail with error))r4r6)�	namespacez
--app-dataz-a data folder used as cache by the virtualenv)�	read_onlyr)r6�typer5z--reset-app-dataz start with empty app data folderz--upgrade-embed-wheelsz.trigger a manual update of the embedded wheels)	r8r>rr�read_only_app_datar�reset_app_datar(�reset)rr*rrCs    rr:r:hs���
�����
\���
�(�(���(�A�J�G�Q�����
<�
�]�g�.H�.H�g�k�k�
Z��d�g�.H�.H�g�k�k�Z�	�������
/���
��� ��
=���
�(�(���(�A�J�G�Q��������� ��Nr/c�^�ddl}|jdddt�d|j��d��y)Nrz	--version�versionz	%(prog)s z from zIdisplay the version of the virtualenv package and its location, then exit)r4rSr6)�
virtualenvr8r�__file__)r*rTs  rr7r7�s8���
������K�=��z�/B�/B�.C�D�
X�	�r/c	��djd�ttj��D��}d}|j	d|jt
jtd�|���}|j�}|jddd	d
dd�
�|jddd	ddd�
�|j|�\}}|rt|j�yy)Nz, c3�VK�|]!\}}tj|��d|�����#y�w)�=N)�logging�getLevelName)r!�c�lines   rr#z#_do_report_setup.<locals>.<genexpr>�s.����d�Mc�'�!�T�W�1�1�$�7�8��!��=�Mc�s�')z6verbosity = verbose - quiet, default {}, mapping => {}r'�)�title�descriptionz-vz	--verbose�count�verbosezincrease verbosity�)r4r3r6r5z-qz--quiet�quietzdecrease verbosityr)
�join�sortedr�items�add_argument_group�formatrYrZ�add_mutually_exclusive_groupr8r>rr')	r*rr�	level_maprB�verbosity_groupr'�optionrCs	         rr9r9�s����	�	�d�V�TZ�T`�T`�Tb�Mc�d�d�I�
B�C��/�/���J�J�w�3�3�F�1�I�>�	�J�0��O� �<�<�>�I�
���4��W�9�Sg�qr��s�
���4��7��Oc�mn��o��'�'��-�I�F�A���V�%�%�&�r/rr)NTN)NNTNr)$�
__future__rrYr�	functoolsr�virtualenv.app_datar�virtualenv.config.cli.parserr�virtualenv.reportrr�virtualenv.run.sessionr	�&virtualenv.seed.wheels.periodic_updater
�virtualenv.versionr�plugin.activatorsr
�plugin.creatorsr�plugin.discoveryr�plugin.seedersrrrr$rFr;r:r7r9�__all__�r/r�<module>r{sf��"��	��-�?�2�*�A�*�1�,�*�*��"�2�>!�
!��>�'� ���r/
Back to Directory File Manager