£Á°èZ¨Ä…–K§‚«“ô4“ÒÙ´dîfUÙÃÅ WKbyÊ¦•êŽ…È®FÒ¿ÊÎóCozá¬S@6{Í:›œêZÌ:Š•_%:¢¾¾~;‘Ã~èŠ©ÊÇí`ÔÑ©úë™µ'5I¿fš×WO%ø9¾«¾DK|€ùÍD”Ýs]nHÕ¶ê×Ó¼ãžªéUWŸÈË%DÒÕ¬ï‘]/Åcx  ‰ï2ß]ä6G[]S£ÔÏ¯rs{úëóµmÒï#UQxo·õÞCe]"±/aÙ&Eã4ú9Jé_ÞåëdãöKë)AÞ                  ¯¹ægƒÛowÐø^d™ý½ßB7áyMä9ÜÖUã
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
<html>
3
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rddlmZ ddlmZmZ ddl
mZ erddlmZ nddlmZ d"ZejeZ G d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  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-python36-pip-20.2.4-5.el8.x86_64/opt/alt/python36/lib/python3.6/site-packages/pip/_internal/utils/wheel.pyr   (   s    zWheelMetadata.__init__c                sJ   yt t| j|S  tk
rD } ztdj| j|W Y d d }~X nX d 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   __classcell__r   r   )r   r   r   $   s   r   c                s   t | |\ } fdd| j D }i }xn|D ]f}t|}|jdd\}}yt| |||< W q. tk
r }	 ztdj|t|	W Y dd}	~	X q.X q.W t||}
t	||
|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    
(
r;   c             C   sj   y t | |}t| |}t|}W n6 tk
rV } ztdj|t|W Y dd}~X nX t|| ||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   r3   check_compatibility)r4   r    r*   r   versionr!   r   r   r   r/   _   s    

$
r/   c             C   s   t dd | j D }dd |D }|s0tdt|dkrPtdjdj||d	 }t|}t|}|j|st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)r1   )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})	setr0   r	   lenr   joinr   r'   r   )sourcer    subdirs	info_dirsr*   info_dir_namecanonical_namer   r   r   r<   t   s     

r<   c             C   sH   y
| j |S  tttfk
rB } ztdj||W Y d d }~X nX d S )Nzcould not read {!r} file: {!r})readr   KeyErrorRuntimeErrorr	   r   )rG   r8   r!   r   r   r   r2      s
    
r2   c             C   s`   dj |}t| |}yt|}W n2 tk
rR } ztdj ||W Y dd}~X nX t j|S )ziReturn the WHEEL metadata of an extracted wheel, if possible.
    Otherwise, raise UnsupportedWheel.
    z{}/WHEELzerror decoding {!r}: {!r}N)r   r2   r   r   r	   r   parsestr)rG   dist_info_dirr8   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S  tk
rV   t dj|Y nX d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intr1   
ValueErrorr   )
wheel_dataversion_textr@   r   r   r   r>      s    r>   c             C   sR   | d t d kr.tdj|djtt| n | t krNt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 piprS   z*Installing from a newer Wheel-Version (%s)N)VERSION_COMPATIBLEr	   r   rF   rV   r3   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   r[   	getLoggerr"   r\   r   r;   r/   r<   r2   r=   r>   r?   r   r   r   r   <module>   s6   
%&