Ë
    »ÿæit  ã                   ó
  — d Z ddl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Z ej                  e«      Zd	ed
edeeef   fd„Zded
edefd„Zdededefd„Zdededefd„Zdedeedf   fd„Zdeedf   d
eddfd„Zy)z/Support functions for working with wheel files.é    N)ÚMessage)ÚParser)Ú
BadZipFileÚZipFile)Úcanonicalize_name)ÚUnsupportedWheel)é   r   Ú	wheel_zipÚnameÚreturnc                 ó¬   — 	 t        | |«      }t        | |«      }t        |«      }t	        ||«       ||fS # t        $ r}t        |› d|› �«      ‚d}~ww xY w)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   Úcheck_compatibility)r
   r   Úinfo_dirÚmetadataÚversionÚes         ún/Volumes/fast/ai/experiments/voice-extract-mac/.venv/lib/python3.12/site-packages/pip/_internal/utils/wheel.pyÚparse_wheelr      sl   € ðDÜ& y°$Ó7ˆÜ! )¨XÓ6ˆÜ Ó)ˆô ˜ Ô&à�XÐÐøô ò DÜ $ Ð'>¸q¸cÐBÓCÐCûðDús   ‚#5 µ	A¾AÁAÚsourcec                 ó¾  — | j                  «       D �ch c]  }|j                  dd«      d   ’Œ }}|D �cg c]  }|j                  d«      sŒ|‘Œ }}|st        d«      ‚t	        |«      dkD  r)t        dj                  dj                  |«      «      «      ‚|d   }t        |«      }t        |«      }|j                  |«      st        d|›d	|›�«      ‚|S c c}w c c}w )
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.
    Ú/r	   r   z
.dist-infoz.dist-info directory not foundz)multiple .dist-info directories found: {}z, z.dist-info directory z does not start with )	ÚnamelistÚsplitÚendswithr   ÚlenÚformatÚjoinr   Ú
startswith)	r   r   ÚpÚsubdirsÚsÚ	info_dirsr   Úinfo_dir_nameÚcanonical_names	            r   r   r   $   sé   € ð ,2¯?©?Ô+<Ó=Ñ+< aˆq�w‰w�s˜A‹˜qÓ!Ð+<€GÐ=á#Ó@™G�q q§z¡z°,Õ'?’˜G€IÐ@áÜÐ?Ó@Ð@ä
ˆ9ƒ~˜ÒÜØ7×>Ñ>¸t¿y¹yÈÓ?SÓTó
ð 	
ð ˜‰|€Hä% hÓ/€MÜ& tÓ,€NØ×#Ñ# NÔ3ÜØ# H <Ð/DÀ^ÐDVÐWó
ð 	
ð €Oùò+ >ùâ@s   “CµCÁCÚpathc                 ó€   — 	 | j                  |«      S # t        t        t        f$ r}t	        d|›d|›�«      ‚d }~ww xY w)Nzcould not read z file: )Úreadr   ÚKeyErrorÚRuntimeErrorr   )r   r(   r   s      r   Úread_wheel_metadata_filer-   C   sJ   € ðGØ�{‰{˜4Ó Ð øô œ¤,Ð/ò GÜ °°¸À¸uÐEÓFÐFûðGús   ‚ “=§8¸=Údist_info_dirc                 ó¼   — |› d�}t        | |«      }	 |j                  «       }t	        «       j                  |«      S # t        $ r}t        d|›d|›�«      ‚d}~ww xY w)ziReturn the WHEEL metadata of an extracted wheel, if possible.
    Otherwise, raise UnsupportedWheel.
    z/WHEELzerror decoding z: N)r-   ÚdecodeÚUnicodeDecodeErrorr   r   Úparsestr)r   r.   r(   Úwheel_contentsÚ
wheel_textr   s         r   r   r   L   sq   € ð ˆ_˜FÐ#€Dä-¨f°dÓ;€NðBØ#×*Ñ*Ó,ˆ
ô ‹8×Ñ˜ZÓ(Ð(øô ò BÜ °°¸¸1¸%Ð@ÓAÐAûðBús   “< ¼	AÁAÁAÚ
wheel_data.c                 óÎ   — | d   }|€t        d«      ‚|j                  «       }	 t        t        t        |j                  d«      «      «      S # t        $ r t        d|›�«      ‚w xY w)zbGiven WHEEL metadata, return the parsed Wheel-Version.
    Otherwise, raise UnsupportedWheel.
    zWheel-VersionzWHEEL is missing Wheel-VersionÚ.zinvalid Wheel-Version: )r   ÚstripÚtupleÚmapÚintr   Ú
ValueError)r5   Úversion_textr   s      r   r   r   _   ss   € ð ˜oÑ.€LØÐÜÐ?Ó@Ð@à× Ñ Ó"€GðFÜ”Sœ˜gŸm™m¨CÓ0Ó1Ó2Ð2øÜò FÜÐ!8¸¸ÐDÓEÐEðFús   ¤'A ÁA$r   c                 ó  — | d   t         d   kD  r8t        dj                  |dj                  t	        t
        | «      «      «      «      ‚| t         kD  r4t        j                  ddj                  t	        t
        | «      «      «       yy)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 pipr7   z*Installing from a newer Wheel-Version (%s)N)ÚVERSION_COMPATIBLEr   r   r    r:   ÚstrÚloggerÚwarning)r   r   s     r   r   r   o   sv   € ð ˆq�zÔ& qÑ)Ò)Üðß‘V˜D #§(¡(¬3¬s°GÓ+<Ó"=Ó>ó
ð 	
ð 
Ô%Ò	%Ü�‰Ø8Ø�H‰H”Sœ˜gÓ&Ó'õ	
ð 
&ó    )Ú__doc__ÚloggingÚemail.messager   Úemail.parserr   Úzipfiler   r   Úpip._vendor.packaging.utilsr   Úpip._internal.exceptionsr   r?   Ú	getLoggerÚ__name__rA   r@   r9   r   r   Úbytesr-   r   r;   r   r   © rC   r   Ú<module>rO      sé   ðÙ 5ã Ý !Ý ß 'å 9å 5àÐ ð 
ˆ×	Ñ	˜8Ó	$€ð˜7ð ¨#ð °%¸¸W¸Ñ2Eó ð$ ð ¨sð °só ð>G Wð G°Cð G¸Eó Gð)˜7ð )°3ð )¸7ó )ð&F˜gð F¨%°°S°©/ó Fð 
  s¨C x¡ð 
¸ð 
Àô 
rC   