OwlCyberSecurity - MANAGER
Edit File: _dists.cpython-312.pyc
� "��gW � �T � d dl Zd dlZd dlZd dlZd dlmZ d dlm Z m Z mZmZm Z mZmZmZmZ d dlmZ d dlmZmZ d dlmZ d dlmZ d dlmZmZ d d lmZm Z m!Z!m"Z" d d l#m$Z$ d dl%m&Z& d dl'm(Z( d d l)m*Z*m+Z+ ddl,m-Z-m.Z.m/Z/ G d� dej` jb � Z2 G d� de� Z1y)� N)�PathLike) � Collection�Dict�Iterable�Iterator�Mapping�Optional�Sequence�Union�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 � � e Zd ZdZdeej ef dej ddfd�Ze de j ded edd fd �� Z dedeej fd�Zd edee fd�Zdeedf dej( fd�Zy)�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� info_location�returnNc � � || _ || _ y �N)�_filesr$ )�selfr# r$ s �V/opt/hc_python/lib/python3.12/site-packages/pip/_internal/metadata/importlib/_dists.py�__init__zWheelDistribution.__init__5 s � � ���*��� �zf�name�locationc �� � � t ||� \ � }� fd�|j � D � }|D ��ci c] \ }}|t ||� �� }}}t j |� � } | || � S c c}}w )Nc 3 � �K � | ]B }|j �� d �� r,|t j |j d d� d � f�� �D y�w)�/r ���N)� startswith�pathlib� PurePosixPath�split)�.0r. �info_dirs �r* � <genexpr>z1WheelDistribution.from_zipfile.<locals>.<genexpr>E sK �� �� � �%�����(��1�~�.� �7�(�(����C��);�B�)?�@�A�%�s �AA)r �namelistr r5 r6 )�clsr- r. r/ �_�paths�fullpath�relpathr# r$ r9 s @r* �from_zipfilezWheelDistribution.from_zipfile= s� �� � "�"�d�+���!� ���� � �� &+� �%*�!��'� �-�b�(�;�;�%*� � � �-�-�h��A� ��5�-�(�(�� s �A(�pathc � � t j t |� � | j v rt | j � S t |� �r'