관리-도구
편집 파일: direct_url.cpython-312.pyc
� G��e � � � d Z ddlZddlZddlZddlmZmZmZm Z m Z mZmZ g d�Z ed� ZdZ ej d� Z G d� d e� Z dd eeef de e ded e e de e f d�Z dd eeef de e ded e e def d�Zdee d ddfd�Zdedeeef fd�Z G d� d� Z G d� d� Z G d� d� Zeeeef Z G d� d� Zy)z PEP 610 � N)�Any�Dict�Iterable�Optional�Type�TypeVar�Union)� DirectUrl�DirectUrlValidationError�DirInfo�ArchiveInfo�VcsInfo�Tzdirect_url.jsonz.^\$\{[A-Za-z0-9-_]+\}(:\$\{[A-Za-z0-9-_]+\})?$c � � e Zd Zy)r N)�__name__� __module__�__qualname__� � ��/builddir/build/BUILDROOT/alt-python312-pip-23.3.1-1.el8.x86_64/opt/alt/python312/lib/python3.12/site-packages/pip/_internal/models/direct_url.pyr r s � �r r �d� expected_type�key�default�returnc �l � || vr|S | | }t ||� st dj |||� � �|S )z3Get value from dictionary and verify expected type.z-{!r} has unexpected type for {} (expected {}))� isinstancer �format�r r r r �values r �_getr! sL � � �!�|��� �c�F�E��e�]�+�&�;�B�B��s�M� � � � �Lr c �B � t | |||� }|�t |� d�� �|S )Nz must have a value)r! r r s r � _get_requiredr# ) s1 � � ��M�3��0�E��}�&�#��.@�'A�B�B��Lr �infos�InfoTypec � � | D �cg c] }|��|�� } }| st d� �t | � dkD rt d� �| d �J �| d S c c}w )Nz/missing one of archive_info, dir_info, vcs_info� z1more than one of archive_info, dir_info, vcs_infor )r �len)r$ �infos r �_exactly_one_ofr* 2 sg � �#�8�d�t�'7�T�8�E�8��&�=� � � �5�z�A�~�&�?� � � ��8�����8�O�� 9s �A�A�kwargsc �\ � | j � D ��ci c] \ }}|�� ||�� c}}S c c}}w )z Make dict excluding None values.)�items)r+ �k�vs r �_filter_noner0 @ s( � �#�\�\�^�=�T�Q��q�}�A�q�D�=�=��=s � (�(c �x � e Zd ZdZ ddededee ddfd�Zedeeee f ded fd �� Z deee f fd �Zy)r �vcs_infoN�vcs� commit_id�requested_revisionr c �. � || _ || _ || _ y �N�r3 r5 r4 )�selfr3 r4 r5 s r �__init__zVcsInfo.__init__H s � � ���"4���"��r r c �x � |�y | t |t d� t |t d� t |t d� �� S )Nr3 r4 r5 )r3 r4 r5 )r# �strr! ��clsr s r � _from_dictzVcsInfo._from_dictR s<