관리-도구
편집 파일: misc.cpython-311.pyc
� �܋f] � �> � d dl Z d dlZd dlZd dlZd dlZd dlZd dlZd dlZd dlZd dl Z d dl Z d dlZd dl mZ d dlmZ d dlmZ d dlmZmZmZ d dlmZ d dlmZmZ d dlmZmZmZmZm Z m!Z!m"Z"m#Z#m$Z$m%Z%m&Z&m'Z'm(Z(m)Z)m*Z* d d l+m,Z, d d l-m.Z. d dl/m0Z0m1Z1m2Z2 d dl3m4Z4 d d l5m6Z6m7Z7 d dl8m9Z9 d dl:m;Z; d dl<m=Z= g d�Z> ej? e@� � ZA e(d� � ZBe&e'eC eCef ZDe&eEeEeEf ZFe&eGe&e$eG e$eG f f ZHeeeeCgef ZIeeeeDgef ZJdeGfd�ZKde&eEdf de&eEeEeEf fd�ZLdeGddfd�ZMdeGfd�ZN e0d e1d� � e2d� � �� � dwd eGd!eOd"e$eI ddfd#�� � ZPd$eddfd%�ZQd$eddfd&�ZReRd'�d(eded)e)eDeCf d"eIddf d*�ZSdeGdeGfd+�ZTdxd eGd-eGdeGfd.�ZUd/eGd0e!eG deGfd1�ZVd/eGddfd2�ZWd/eGd0e!eG deGfd3�ZXd/eGdeGfd4�ZYd/eGdeGfd5�ZZd6eGdeEfd7�Z[d8e\deGfd9�Z]d:e!e!e de&e#eG e#eE f fd;�Z^deGdeOfd<�Z_ej` fd=ed>eEde eaddf fd?�ZbdydeGd@eOdeGfdA�ZcdeGde&eGeGf fdB�ZddCeGdDeGddfdE�ZedeGdeOfdF�ZfdGedHeddfdI�Zg G dJ� dKe� � ZhdLedMede'e fdN�ZidOeGdPe$eE deGfdQ�ZjdzdSeGdTeGdeGfdU�ZkdSeGde&e$eG e$eE f fdV�ZldSeGdeHfdW�ZmdSeGdeGfdX�ZndYeGdZeeGge&edf f de&eGeHf fd[�ZodSeGdeHfd\�ZpdSeGde&eG fd]�ZqdYeGde&eGeGe&e$eG e$eG f f fd^�ZrdYeGdeGfd_�ZsdYeGdeGfd`�Ztdae,deGfdb�Zu ed�c� � G dd� de� � � � ZvdfeGdevfdg�ZwdYeGdevfdh�ZxdieOddfdj�Zyd{dk�ZzdeOfdl�Z{d|deGdneEde&eeEf fdo�Z|dpe!e de"e&eef fdq�Z}dreeBgeOf dpe!eB de&e!eB e!eB f fds�Z~ G dt� due.� � Zd{dv�Z�dS )}� N)� dataclass)�partial)�StringIO)�filterfalse�tee�zip_longest)�Path)�FunctionType� TracebackType)�Any�BinaryIO�Callable�Dict� Generator�Iterable�Iterator�List�Optional�TextIO�Tuple�Type�TypeVar�Union�cast)�Requirement)�BuildBackendHookCaller)�retry�stop_after_delay� wait_fixed)�__version__)�CommandError�ExternallyManagedEnvironment)�get_major_minor_version)�WINDOWS)�running_under_virtualenv)�rmtree�display_path� backup_dir�ask�splitext�format_size�is_installable_dir�normalize_path�renames�get_prog� ensure_dir�remove_auth_from_url�check_externally_managed� ConfiguredBuildBackendHookCaller�T�returnc � � t j � t j � t � � dd� � } t j � | � � } dt � d| � dt � � � d�S )Nz..zpip z from z (python �))�os�path�join�dirname�__file__�abspathr r# )�pip_pkg_dirs �O/opt/cloudlinux/venv/lib64/python3.11/site-packages/pip/_internal/utils/misc.py�get_pip_versionr@ J sb � ��'�,�,�r�w���x�8�8�$��E�E�K��'�/�/�+�.�.�K�W�+�W�W�[�W�W�;R�;T�;T�W�W�W�W� �py_version_info.c � � t | � � dk r| dt | � � z dz z } nt | � � dk r | dd� } t d| � � S )ax Convert a tuple of ints representing a Python version to one of length three. :param py_version_info: a tuple of ints representing a Python version, or None to specify no version. The tuple can have any length. :return: a tuple of length three if `py_version_info` is non-None. Otherwise, return `py_version_info` unchanged (i.e. None). � )r N�VersionInfo)�lenr )rB s r? �normalize_version_inforG Q sf � � �?���a����A��O� 4� 4�4��<�<��� �_� � �� !� !�)�"�1�"�-��� ��/�/�/rA r9 c �� � t j | � � dS # t $ r<}|j t j k r|j t j k r� Y d}~dS Y d}~dS d}~ww xY w)z os.path.makedirs without EEXIST.N)r8 �makedirs�OSError�errno�EEXIST� ENOTEMPTY)r9 �es r? r0 r0 d s� � �� ��D�������� � � ��7�e�l�"�"�q�w�%�/�'A�'A�� #�"�"�"�"�"�'A�'A�'A�'A�'A�'A��������s � � A�+A�Ac �� � t j � t j d � � } | dv rt j � d�S | S # t t t f$ r Y nw xY wdS )Nr )z__main__.pyz-cz -m pip�pip) r8 r9 �basename�sys�argv� executable�AttributeError� TypeError� IndexError)�progs r? r/ r/ n sp � � ��w�������,�,���(�(�(��n�-�-�-�-��K���I�z�2� � � ��� �����5s �AA �A �A �A TrD g �?)�reraise�stop�waitF�dir� ignore_errors�onexcc � � |rt }|�t }t t t t t f t � � |�� � }t j dk rt j | |�� � d S t j | |�� � d S )N�r^ )rD � )�onerror)�_onerror_ignore�_onerror_reraiser r r �OnExc�OnErr�rmtree_errorhandlerrR �version_info�shutilr&