File manager - Edit - /opt/saltstack/salt/lib/python3.10/site-packages/pip/_internal/metadata/importlib/__pycache__/_dists.cpython-310.pyc
Back
o ;jC � @ s, d dl mZ d dlZd dlZd dlZd dlZd dlm Z m Z mZmZm Z d dlmZ d dlmZ d dlmZ d dlmZmZ d dlmZ d d lmZ d d lmZmZ d dlmZm Z m!Z!m"Z" d dl#m$Z$ d d l%m&Z& d dl'm(Z( d dl)m*Z*m+Z+ ddl,m-Z-m.Z.m/Z/ G dd� dej0j1�Z2G dd� de�Z1dS )� )�annotationsN)� Collection�Iterable�Iterator�Mapping�Sequence)�PathLike)�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 @ sF e Zd ZdZddd �Zed dd��Zd!dd�Zd"dd�Zd#dd�Z dS )$�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. �files�%Mapping[pathlib.PurePosixPath, bytes]� info_location�pathlib.PurePosixPath�return�Nonec C s || _ || _d S �N)�_filesr! )�selfr r! � r( �[/opt/saltstack/salt/lib/python3.10/site-packages/pip/_internal/metadata/importlib/_dists.py�__init__0 s zWheelDistribution.__init__�zf�zipfile.ZipFile�name�str�locationc sL t �|�\� }� fdd���� D �}�fdd�|D �}t�|� �}| ||�S )Nc 3 s: � | ]}|� � � d ��r|t�|�d d�d �fV qdS )�/r ���N)� startswith�pathlib� PurePosixPath�split)�.0r- )�info_dirr( r) � <genexpr>@ s � � �z1WheelDistribution.from_zipfile.<locals>.<genexpr>c s i | ] \}}|t � |��qS r( )r )r6 �fullpath�relpath)r+ r( r) � <dictcomp>E s ��z2WheelDistribution.from_zipfile.<locals>.<dictcomp>)r Znamelistr3 r4 )�clsr+ r- r/ �_�pathsr r! r( )r7 r+ r) �from_zipfile8 s � � zWheelDistribution.from_zipfile�pathr �Iterator[pathlib.PurePosixPath]c C s&