ó
    Þ jŽ  ã                   ó"  • S r SSKrSSKJr  SSKJr  SSKJr  SSKJ	r	J
r
  SSKJr  SSKJr  S	r\R                   " \5      rS
\
S\S\\\4   4S jrS\
S\S\4S jrS\
S\S\4S jrS\
S\S\4S jrS\S\\S4   4S jrS\\S4   S\SS4S jrg)z0Support functions for working with wheel files.
é    N)ÚMessage)ÚParser)ÚTuple)Ú
BadZipFileÚZipFile)Úcanonicalize_name)ÚUnsupportedWheel)é   r   Ú	wheel_zipÚnameÚreturnc                 ó¦   •  [        X5      n[        X5      n[        U5      n[	        XA5        X#4$ ! [         a  n[        U SU 35      eSnAff = f)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         ÚS/var/www/html/gaurav/venv/lib/python3.13/site-packages/pip/_internal/utils/wheel.pyÚparse_wheelr      sd   € ðDÜ& yÓ7ˆÜ! )Ó6ˆÜ Ó)ˆô ˜Ô&àÐÐøô ó DÜ $ Ð'>¸q¸cÐBÓCÐCûðDús   ‚!1 ±
A»AÁAÚsourcec                 óè  • U R                  5        Vs1 sH  o"R                  SS5      S   iM     nnU Vs/ sH  oDR                  S5      (       d  M  UPM     nnU(       d  [        S5      e[	        U5      S:”  a)  [        SR                  SR                  U5      5      5      eUS   n[        U5      n[        U5      nUR                  U5      (       d  [        SU< S	U< 35      eU$ s  snf s  snf )
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�w‰w�s˜A‹˜qÔ!Ñ+<€GÐ=á#Ó@™G�q§z¡z°,×'?—™G€IÐ@æÜÐ?Ó@Ð@ä
ˆ9ƒ~˜ÓÜØ7×>Ñ>¸t¿y¹yÈÓ?SÓTó
ð 	
ð ˜‰|€Hä% hÓ/€MÜ& tÓ,€NØ×#Ñ# N×3Ñ3ÜØ# H¡<Ð/DÀ^ÑDVÐWó
ð 	
ð €Oùò+ >ùâ@s   “C*¶C/ÁC/Úpathc                 ó†   •  U R                  U5      $ ! [        [        [        4 a  n[	        SU< SU< 35      eS nAff = f)Nzcould not read z file: )Úreadr   ÚKeyErrorÚRuntimeErrorr	   )r   r)   r   s      r   Úread_wheel_metadata_filer.   E   sJ   € ðGØ�{‰{˜4Ó Ð øô œ¤,Ð/ó GÜ °±¸À¹uÐEÓFÐFûðGús   ‚ “A ¨;»A Údist_info_dirc                 óÀ   • U S3n[        X5      n UR                  5       n[	        5       R                  U5      $ ! [         a  n[        SU< SU< 35      eSnAff = f)zaReturn 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   N   so   € ð ˆ_˜FÐ#€Dä-¨fÓ;€NðBØ#×*Ñ*Ó,ˆ
ô ‹8×Ñ˜ZÓ(Ð(øô ó BÜ °±¸¸1¹%Ð@ÓAÐAûðBús   ’; »
AÁAÁAÚ
wheel_data.c                 óÔ   • U S   nUc  [        S5      eUR                  5       n [        [        [        UR                  S5      5      5      $ ! [         a    [        SU< 35      ef = f)zZGiven 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)r6   Úversion_textr   s      r   r   r   a   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                 ó  • U S   [         S   :”  a8  [        SR                  USR                  [	        [
        U 5      5      5      5      eU [         :”  a4  [        R                  SSR                  [	        [
        U 5      5      5        gg)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 pipr8   z*Installing from a newer Wheel-Version (%s)N)ÚVERSION_COMPATIBLEr	   r    r!   r;   ÚstrÚloggerÚwarning)r   r   s     r   r   r   q   sv   € ð ˆq�zÔ& qÑ)Ó)Üðß‘V˜D #§(¡(¬3¬s°GÓ+<Ó"=Ó>ó
ð 	
ð 
Ô%Ó	%Ü�‰Ø8Ø�H‰H”Sœ˜gÓ&Ó'õ	
ð 
&ó    )Ú__doc__ÚloggingÚemail.messager   Úemail.parserr   Útypingr   Úzipfiler   r   Úpip._vendor.packaging.utilsr   Úpip._internal.exceptionsr	   r@   Ú	getLoggerÚ__name__rB   rA   r   r   Úbytesr.   r   r<   r   r   © rD   r   Ú<module>rQ      sî   ðñó Ý !Ý Ý ß 'å 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¡ð 
¸ð 
Àõ 
rD   