OwlCyberSecurity - MANAGER
Edit File: wheel.cpython-39.pyc
a )��e� � @ s� d Z ddlZddlmZ ddlmZ ddlmZ ddlm Z m Z ddlmZ ddl mZ d Ze�e�Ze eeeef d �dd�Ze eed �dd�Ze eed�dd�Ze eed�dd�Zeeedf d�dd�Zeedf edd�dd�ZdS )z0Support functions for working with wheel files. � N)�Message)�Parser)�Tuple)� BadZipFile�ZipFile)�canonicalize_name)�UnsupportedWheel)� r )� wheel_zip�name�returnc C sl z t | |�}t| |�}t|�}W n8 tyX } z td�|t|����W Y d}~n d}~0 0 t||� ||fS )z�Extract 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 �format�str�check_compatibility)r r �info_dir�metadata�version�e� r �Z/home/gouroczh/virtualenv/pat/3.9/lib/python3.9/site-packages/pip/_internal/utils/wheel.py�parse_wheel s * r )�sourcer r c C s� dd� | � � D �}dd� |D �}|s,td��t|�dkrLtd�d�|����|d }t|�}t|�}|�|�s~td �||���|S )z�Returns 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 h | ]}|� d d�d �qS )�/r r )�split)�.0�pr r r � <setcomp>- � z&wheel_dist_info_dir.<locals>.<setcomp>c S s g | ]}|� d �r|�qS )z .dist-info)�endswith)r �sr r r � <listcomp>/ r 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})�namelistr �lenr �joinr � startswith)r r �subdirsZ info_dirsr Z info_dir_name�canonical_namer r r r &