R`i d Z ddlZddlmZ ddlmZ ddlmZ ddlm Z m Z ddlmZ ddl mZ d Z ej e Zd e dedeeef fd Zde dedefdZde dedefdZde dedefdZdedeedf fdZdeedf deddfdZy)z0Support functions for working with wheel files. N)Message)Parser)Tuple) BadZipFileZipFile)canonicalize_name)UnsupportedWheel) r wheel_zipnamereturnc t | | }t | | }t | }t || ||fS # t $ r)}t dj |t | d}~ww xY w)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_dirmetadataversiones /builddir/build/BUILDROOT/alt-python312-pip-23.3.1-3.el8.x86_64/opt/alt/python312/lib/python3.12/site-packages/pip/_internal/utils/wheel.pyparse_wheelr sr S&y$7!)X6) &X S<CCD#a&QRRSs #5 A'$A""A'sourcec | j D ch c] }|j dd d }}|D cg c] }|j d s| }}|st d t | dkD r)t dj dj | |d }t | }t | }|j | st dj || |S c c}w c c}w ) 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. /r r z .dist-infoz.dist-info directory not foundz)multiple .dist-info directories found: {}z, z2.dist-info directory {!r} does not start with {!r}) namelistsplitendswithr lenr joinr startswith) r r psubdirss info_dirsr info_dir_namecanonical_names r r r &