+
     h  c                   s    R t ^ RIt^ RIHt ^ RIHt ^ RIHt ^ RIH	t	H
t
 ^ RIHt ^ RIHt Rt]P                   ! ]4      tR R	 ltR
 R ltR R ltR R ltR R ltR R ltR# )z/Support functions for working with wheel files.N)Message)Parser)Tuple)
BadZipFileZipFile)canonicalize_name)UnsupportedWheelc                s^    V ^8  d   QhR\         R\        R\        \        \        3,          /# )   	wheel_zipnamereturn)r   strr   r    format   ">/usr/lib/python3.14/site-packages/pip/_internal/utils/wheel.py__annotate__r      s*      7 # %W2E     c                s     \        W4      p\        W4      p\        V4      p\	        YA4       Y#3#   \         d   p\        T RT 24      hRp?ii ; i)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_dirwheel_metadatawheel_versionr   check_compatibility)r   r	   info_dirZmetadataversione   &&    r   parse_wheelr      sd    D&y7!)6) &  D$'>qcBCCDs   !1 AAAc                s<    V ^8  d   QhR\         R\        R\        /# )r   sourcer	   r
   )r   r   r   r   r   r   r   %   s!       s s r   c                s    V P                  4        Uu0 uF  q"P                  R^4      ^ ,          kK  	  ppV Uu. uF  qDP                  R4      '       g   K  VNK  	  ppV'       g   \        R4      h\	        V4      ^8  d*   \        RP                  RP                  V4      4      4      hV^ ,          p\        V4      p\        V4      pVP                  V4      '       g   \        RV: RV: 24      hV# u upi u upi )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.
Z/z
.dist-infoz.dist-info directory not foundz)multiple .dist-info directories found: {}z, z.dist-info directory z does not start with )	ZnamelistsplitZendswithr   Zlenr   joinr   Z
startswith)	r   r	   ZpZsubdirsZsZ	info_dirsr   Zinfo_dir_nameZcanonical_names	   &&       r   r   r   %   s     ,2??+<=+<awwsAq!!+<G=#@Gqzz,'?GI@?@@
9~7>>tyy?ST
 	
 |H%h/M&t,N##N33#H</D^DVW
 	
 O+ >@s   !C6C;C;c                <    V ^8  d   QhR\         R\        R\        /# )r   r   pathr
   )r   r   Zbytesr   r   r   r   r   D   s&     G GW GC GE Gr   c                 s     V P                  V4      #   \        \        \        3 d   p\	        R T: RT: 24      hRp?ii ; i)zcould not read z file: N)Zreadr   ZKeyErrorZRuntimeErrorr   )r   r   r   s   && r   read_wheel_metadata_filer    D   sJ    G{{4   ,/ GuEFFGs    A<Ac                r   )r   r   dist_info_dirr
   )r   r   r    r   r   r   r   r   M   s!     ) )7 )3 )7 )r   c                s    V R2p\        W4      p VP                  4       p\	        4       P                  T4      #   \         d   p\        RT: RT: 24      hRp?ii ; i)zaReturn the WHEEL metadata of an extracted wheel, if possible.
Otherwise, raise UnsupportedWheel.
z/WHEELzerror decoding z: N)r    ZdecodeZUnicodeDecodeErrorr   r   Zparsestr)r   r!   r   Zwheel_contentsZ
wheel_textr   r   r   r   r   M   so     _F#D-f;NB#**,
 8Z((  B1%@AABs   ; AAAc                sJ    V ^8  d   QhR\         R\        \        R3,          /# )r   
wheel_datar
   .)r    r   intr   r   r   r   r   `   s&     F Fg F%S/ Fr   c                s    V R,          pVf   \        R4      hVP                  4       p \        \        \        VP                  R4      4      4      #   \         d    \        RT: 24      hi ; i)zZGiven WHEEL metadata, return the parsed Wheel-Version.
Otherwise, raise UnsupportedWheel.
zWheel-VersionzWHEEL is missing Wheel-Version.zinvalid Wheel-Version: )r   ZstripZtuplemapr#   r   Z
ValueError)r"   Zversion_textr   s   &  r   r   r   `   ss     o.L?@@  "GFSgmmC0122 F!8DEEFs   'A A-c                sN    V ^8  d   QhR\         \        R3,          R\        RR/# )r   r   .r	   r
   N)r   r#   r   r   r   r   r   r   p   s)     
 
sCx 
 
 
r   c                s(   V ^ ,          \         ^ ,          8  d9   \        RP                  VRP                  \	        \
        V 4      4      4      4      hV \         8  d6   \        P                  RRP                  \	        \
        V 4      4      4       R# R# )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
zB{}'s Wheel-Version ({}) is not compatible with this version of pipr$   z*Installing from a newer Wheel-Version (%s)N)VERSION_COMPATIBLEr   r   r   r%   r   loggerZwarning)r   r	   s   &&r   r   r   p   sv     qz&q))VD#((3sG+<"=>
 	
 
%	%8HHSg&'	
 
&r   )i   i    )Z__doc__ZloggingZemail.messager    Zemail.parserr   Ztypingr   Zzipfiler   r   Zpip._vendor.packaging.utilsr   Zpip._internal.exceptionsr   r&   Z	getLoggerZ__name__r'   r   r   r    r   r   r   ) r   r   <module>r(      sU    5  !   ' 9 5  
		8	$$>G)&F 
r   