관리-도구
편집 파일: _dists.cpython-38.pyc
U &?�fQ � @ s d dl Zd dlZd dlZd dlZd dlmZmZm Z m Z mZmZm Z mZ d dlmZ d dlmZmZ d dlmZ d dlmZ d dlmZmZ d dlmZmZmZmZ d d l m!Z! d d l"m#Z# d dl$m%Z% d dl&m'Z'm(Z( d dl)m*Z*m+Z+m,Z, G dd� dej-j.�Z/G dd� de�Z.dS )� N)� Collection�Dict�Iterable�Iterator�Mapping�Optional�Sequence�cast)�Requirement)�NormalizedName�canonicalize_name)�Version)�parse)�InvalidWheel�UnsupportedWheel)�BaseDistribution�BaseEntryPoint�InfoPath�Wheel)�normalize_path)�get_requirement)� TempDirectory)�parse_wheel�read_wheel_metadata_file� )�BasePath�get_dist_canonical_name�*parse_name_and_version_from_info_directoryc @ sr e Zd ZdZeejef ejdd�dd�Ze e jeed d�dd��Z eeej d �d d�Zeee d�d d�ZdS )�WheelDistributiona� An ``importlib.metadata.Distribution`` read from a wheel. Although ``importlib.metadata.PathDistribution`` accepts ``zipfile.Path``, its implementation is too "lazy" for pip's needs (we can't keep the ZipFile handle open for the entire lifetime of the distribution object). This implementation eagerly reads the entire metadata directory into the memory instead, and operates from that. N)�files� info_location�returnc C s || _ || _d S �N)�_filesr )�selfr r � r% �U/opt/hc_python/lib/python3.8/site-packages/pip/_internal/metadata/importlib/_dists.py�__init__3 s zWheelDistribution.__init__)�zf�name�locationr! c sL t �|�\� }� fdd���� D �}�fdd�|D �}t�|� �}| ||�S )Nc 3 s8 | ]0}|� � � d ��r|t�|�d d�d �fV qdS )�/r ���N)� startswith�pathlib� PurePosixPath�split)�.0r) )�info_dirr% r&