<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0-alpha1/dist/css/bootstrap.min.css" rel="stylesheet"
        integrity="sha384-GLhlTQ8iRABdZLl6O3oVMWSktQOp6b7In1Zl3/Jr59b6EGGoI1aFkw7cmDA6j6gD" crossorigin="anonymous">
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.3.0/css/all.min.css"
        integrity="sha512-SzlrxWUlpfuzQ+pcUCosxcglQRNAq/DZjVsC0lE40xsADsfeQoEypE+enwcOiGjk/bSuGGKHEyjSoQ1zVisanQ=="
        crossorigin="anonymous" referrerpolicy="no-referrer" />
</head>
</html>

Re                 @   s  d  Z  d d l m Z d d l Z d d l m Z d d l m Z d d l m	 Z	 d d l
 m Z d d l m Z m Z d d	 l m Z d d
 l m Z d d l m Z e r d d l m Z d d l m Z m Z d d l
 m Z e r d d l m Z n d d l m Z d" Z e j e  Z  Gd d   d e  Z! d d   Z" d d   Z# d d   Z$ d d   Z% d d   Z& d d   Z' d  d!   Z( d S)#z0Support functions for working with wheel files.
    )absolute_importN)Parser)ZipFile)canonicalize_name)DistInfoDistribution)PY2
ensure_str)UnsupportedWheel)DictMetadata)MYPY_CHECK_RUNNING)Message)DictTuple)Distribution)
BadZipfile)
BadZipFile   c                   s:   e  Z d  Z d Z   f d d   Z   f d d   Z   S)WheelMetadatazaMetadata provider that maps metadata decoding exceptions to our
    internal exception type.
    c                s#   t  t |   j |  | |  _ d  S)N)superr   __init___wheel_name)selfmetadata
wheel_name)	__class__ /builddir/build/BUILDROOT/alt-python35-pip-20.2.4-5.el8.x86_64/opt/alt/python35/lib/python3.5/site-packages/pip/_internal/utils/wheel.pyr   (   s    zWheelMetadata.__init__c                sa   y t  t |   j |  SWn@ t k
 r\ } z  t d j |  j |    WYd  d  } ~ Xn Xd  S)Nz"Error decoding metadata for {}: {})r   r   get_metadataUnicodeDecodeErrorr	   formatr   )r   namee)r   r   r   r   -   s    zWheelMetadata.get_metadata)__name__
__module____qualname____doc__r   r   r   r   )r   r   r   $   s   r   c                s   t  |  |  \   }   f d d   |  j   D } i  } x | D] } t |  } | j d d  \ } } y t |  |  | | <WqA t k
 r }	 z# t d j | t |	     WYd d }	 ~	 XqA XqA Wt | |  }
 t	 d | d |
 d	 |  S)
zaGet a pkg_resources distribution given a wheel.

    :raises UnsupportedWheel: on any errors
    c                s.   g  |  ]$ } | j  d  j     r |  q S)z{}/)
startswithr   ).0p)info_dirr   r   
<listcomp>C   s   	 z8pkg_resources_distribution_for_wheel.<locals>.<listcomp>/r   z{} has an invalid wheel, {}Nlocationr   project_name)
parse_wheelnamelistr   splitread_wheel_metadata_filer	   r   strr   r   )	wheel_zipr    r,   _metadata_filesmetadata_textpath	full_pathmetadata_namer!   r   r   )r)   r   $pkg_resources_distribution_for_wheel:   s    2r:   c             C   s   y. t  |  |  } t |  |  } t |  } WnC t k
 rs } z# t d j | t |     WYd d } ~ Xn Xt | |  | | f S)zExtract information from the provided wheel, ensuring it meets basic
    standards.

    Returns the name of the .dist-info directory and the parsed WHEEL metadata.
    z{} has an invalid wheel, {}N)wheel_dist_info_dirwheel_metadatawheel_versionr	   r   r2   check_compatibility)r3   r    r)   r   versionr!   r   r   r   r.   _   s    .r.   c             C   s   t  d d   |  j   D  } d d   | D } | sD t d   t |  d k rt t d j d j |     | d	 } t |  } t |  } | j |  s t d
 j | |    t |  S)zReturns the name of the contained .dist-info directory.

    Raises AssertionError or UnsupportedWheel if not found, >1 found, or
    it doesn't match the provided name.
    c             s   s%   |  ] } | j  d  d  d Vq d S)r+   r   r   N)r0   )r'   r(   r   r   r   	<genexpr>|   s    z&wheel_dist_info_dir.<locals>.<genexpr>c             S   s%   g  |  ] } | j  d   r |  q S)z
.dist-info)endswith)r'   sr   r   r   r*   ~   s   	 z'wheel_dist_info_dir.<locals>.<listcomp>z.dist-info directory not foundr   z)multiple .dist-info directories found: {}z, r   z2.dist-info directory {!r} does not start with {!r})	setr/   r	   lenr   joinr   r&   r   )sourcer    subdirs	info_dirsr)   info_dir_namecanonical_namer   r   r   r;   t   s     
r;   c             C   s^   y |  j  |  SWnF t t t f k
 rY } z t d j | |    WYd  d  } ~ Xn Xd  S)Nzcould not read {!r} file: {!r})readr   KeyErrorRuntimeErrorr	   r   )rF   r7   r!   r   r   r   r1      s
    r1   c             C   s~   d j  |  } t |  |  } y t |  } Wn= t k
 rm } z t d j  | |    WYd d } ~ Xn Xt   j |  S)ziReturn the WHEEL metadata of an extracted wheel, if possible.
    Otherwise, raise UnsupportedWheel.
    z{}/WHEELzerror decoding {!r}: {!r}N)r   r1   r   r   r	   r   parsestr)rF   dist_info_dirr7   wheel_contents
wheel_textr!   r   r   r   r<      s    +r<   c             C   s|   |  d } | d k r" t  d   | j   } y  t t t | j d    SWn' t k
 rw t  d j |    Yn Xd S)zbGiven WHEEL metadata, return the parsed Wheel-Version.
    Otherwise, raise UnsupportedWheel.
    zWheel-VersionNzWHEEL is missing Wheel-Version.zinvalid Wheel-Version: {!r})r	   striptuplemapintr0   
ValueErrorr   )
wheel_dataversion_textr?   r   r   r   r=      s    
 r=   c             C   ss   |  d t  d k rA t d j | d j t t |       n. |  t  k ro t j d d j t t |     d S)a  Raises errors or warns if called with an incompatible Wheel-Version.

    pip should refuse to install a Wheel-Version that's a major series
    ahead of what it's compatible with (e.g 2.0 > 1.1); and warn when
    installing a version only minor version ahead (e.g 1.2 > 1.1).

    version: a 2-tuple representing a Wheel-Version (Major, Minor)
    name: name of wheel or package to raise exception about

    :raises UnsupportedWheel: when an incompatible Wheel-Version is given
    r   zB{}'s Wheel-Version ({}) is not compatible with this version of piprR   z*Installing from a newer Wheel-Version (%s)N)VERSION_COMPATIBLEr	   r   rE   rU   r2   loggerwarning)r?   r    r   r   r   r>      s    $r>   )r   r   ))r%   
__future__r   loggingemail.parserr   zipfiler   Zpip._vendor.packaging.utilsr   Zpip._vendor.pkg_resourcesr   Zpip._vendor.sixr   r   pip._internal.exceptionsr	   !pip._internal.utils.pkg_resourcesr
   pip._internal.utils.typingr   email.messager   typingr   r   r   r   r   rZ   	getLoggerr"   r[   r   r:   r.   r;   r1   r<   r=   r>   r   r   r   r   <module>   s6   %&