U
ʗRe @ s d Z ddlZddlmZ ddlmZ ddlmZ ddlm Z m
Z
ddlmZ ddl
mZ d ZeeZe
eeeef d
ddZe
eed
ddZe
eedddZe
eedddZeeedf dddZeedf eddddZdS )z0Support functions for working with wheel files.
N)Message)Parser)Tuple)
BadZipFileZipFile)canonicalize_name)UnsupportedWheel) r ) wheel_zipnamereturnc
C sj z t | |}t| |}t|}W n6 tk
rV } ztd|t|W 5 d}~X Y nX t|| ||fS )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_dirwheel_metadata
wheel_versionr formatstrcheck_compatibility)r
r info_dirmetadataversione r /builddir/build/BUILDROOT/alt-python38-pip-22.2.1-2.el8.x86_64/opt/alt/python38/lib/python3.8/site-packages/pip/_internal/utils/wheel.pyparse_wheel s
&
r )sourcer r c C s dd | D }dd |D }|s,tdt|dkrLtdd||d }t|}t|}||s~td
|||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 h | ]}| d dd qS )/r r )split).0pr r r