관리-도구
편집 파일: direct_url.cpython-38.pyc
U ʗRe� � @ sB d Z ddlZddlZddlZddlmZmZmZm Z m Z mZmZ dddddgZ ed �Zd Ze�d�ZG dd� de�Zdeeef e e ee e e e d �dd�Zdeeef e e ee e ed �dd�Zee d dd�dd�Zeeeef d�dd�ZG dd� d�ZG dd� d�ZG dd� d�Zeeeef ZG dd� d�ZdS )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 @ s e Zd ZdS )r N)�__name__� __module__�__qualname__� r r ��/builddir/build/BUILDROOT/alt-python38-pip-22.2.1-2.el8.x86_64/opt/alt/python38/lib/python3.8/site-packages/pip/_internal/models/direct_url.pyr s )�d� expected_type�key�default�returnc C s4 || kr|S | | }t ||�s0td�|||���|S )z3Get value from dictionary and verify expected type.z-{!r} has unexpected type for {} (expected {}))� isinstancer �format�r r r r �valuer r r �_get s ��r c C s( t | |||�}|d kr$t|� d���|S )Nz must have a value)r r r r r r � _get_required) s r �InfoType)�infosr c C sF dd� | D �} | st d��t| �dkr.t d��| d d k s>t�| d S )Nc S s g | ]}|d k r|�qS �Nr )�.0�infor r r � <listcomp>3 s z#_exactly_one_of.<locals>.<listcomp>z/missing one of archive_info, dir_info, vcs_info� z1more than one of archive_info, dir_info, vcs_infor )r �len�AssertionError)r r r r �_exactly_one_of2 s ��r( )�kwargsr c K s dd� | � � D �S )z Make dict excluding None values.c S s i | ]\}}|d k r||�qS r! r )r"