+
    VBi,                        R t ^ RIt^ RIt^ RIt^ RIt^ RIHt ^ RIHtH	t	H
t
HtHtHtHtHt ^ RIHt ^ RIHtHt ^ RIHtHt ]]]]]3,          ]]3,          tRR.t ! R	 R4      t ! R
 R]]4      t ! R R]]4      t ! R R]4      t R# )z)Source of information about a wheel file.N)contextmanager)BinaryIOClassVarIteratorListOptionalTupleTypecast)InstallerError)RecordEntryparse_record_file)canonicalize_nameparse_wheel_filenameWheelSource	WheelFilec                      a a ] tR t^t oRt]tV3R lV 3R llt]R 4       t	]R 4       t
]V3R lR l4       tV3R lR	 ltV3R
 lR ltV3R lR ltV3R ltRtVtV ;t# )r   zqRepresents an installable wheel.

This is an abstract class, whose methods have to be implemented by subclasses.
c                *   < V ^8  d   QhRS[ RS[ RR/# )   distributionversionreturnNstr)format__classdict__s   "6/usr/lib/python3.14/site-packages/installer/sources.py__annotate__WheelSource.__annotate__   s"      S 3 4     c                <   < \         SV `  4        Wn        W n        R# )zInitialize a WheelSource object.

:param distribution: distribution name (like ``urllib3``)
:param version: version associated with the wheel
N)super__init__r   r   )selfr   r   	__class__s   &&&r   r"   WheelSource.__init__   s     	(r   c                :    V P                    RV P                   R2# ) Name of the dist-info directory.-
.dist-infor   r   r#   s   &r   dist_info_dirWheelSource.dist_info_dir&   s"     ##$Adll^:>>r   c                :    V P                    RV P                   R2# )zName of the data directory.r(   z.datar*   r+   s   &r   data_dirWheelSource.data_dir+   s"     ##$Adll^599r   c                0   < V ^8  d   QhRS[ S[,          /# r   r   r   r   )r   r   s   "r   r   r   1   s     " "T#Y "r   c                    \         h)zGet names of all files in the dist-info directory.

Sample usage/behaviour::

    >>> wheel_source.dist_info_filenames
    ['METADATA', 'WHEEL']
NotImplementedErrorr+   s   &r   dist_info_filenamesWheelSource.dist_info_filenames0   s
     "!r   c                &   < V ^8  d   QhRS[ RS[ /# r   filenamer   r   )r   r   s   "r   r   r   ;   s     
" 
"s 
"s 
"r   c                    \         h)zGet contents, from ``filename`` in the dist-info directory.

Sample usage/behaviour::

    >>> wheel_source.read_dist_info("METADATA")
    ...

:param filename: name of the file
r5   )r#   r;   s   &&r   read_dist_infoWheelSource.read_dist_info;   s
     "!r   c                   < V ^8  d   QhRR/# )r   r   N )r   r   s   "r   r   r   G   s     " " "r   c                    \         h)zValidate ``RECORD`` of the wheel.

This method should be called before :py:func:`install <installer.install>`
if validation is required.
r5   r+   s   &r   validate_recordWheelSource.validate_recordG   s
     "!r   c                0   < V ^8  d   QhRS[ S[,          /# r2   r   WheelContentElement)r   r   s   "r   r   r   O   s     " "h':; "r   c                    \         h)af  Sequential access to all contents of the wheel (including dist-info files).

This method should return an iterable. Each value from the iterable must be a
tuple containing 3 elements:

- record: 3-value tuple, to pass to
  :py:meth:`RecordEntry.from_elements <installer.records.RecordEntry.from_elements>`.
- stream: An :py:class:`io.BufferedReader` object, providing the contents of the
  file at the location provided by the first element (path).
- is_executable: A boolean, representing whether the item has an executable bit.

All paths must be relative to the root of the wheel.

Sample usage/behaviour::

    >>> iterable = wheel_source.get_contents()
    >>> next(iterable)
    (('pkg/__init__.py', '', '0'), <...>, False)

This method may be called multiple times. Each iterable returned must
provide the same content upon reading from a specific file's stream.
r5   r+   s   &r   get_contentsWheelSource.get_contentsO   s
    . "!r   c                F   < V ^8  d   Qh/ S[ S[S[,          ,          ;R&   # )r   validation_error)r   r	   	Exception)r   r   s   "r   r   r      s      tI/< r   r*   )__name__
__module____qualname____firstlineno____doc__
ValueErrorrK   r"   propertyr,   r/   r7   r=   rB   rH   __annotate_func____static_attributes____classdictcell____classcell__r$   r   s   @@r   r   r      s~     
 3=  ? ? : : " "
" 
"" "" "w  r   c                   T   a a ] tR t^it oRtV3R lV 3R lltV3R lR ltRtVtV ;t	# )_WheelFileValidationErrorz*Raised when a wheel file fails validation.c                4   < V ^8  d   QhRS[ S[,          RR/# )r   issuesr   Nr3   )r   r   s   "r   r   &_WheelFileValidationError.__annotate__l   s      tCy T r   c                D   < \         SV `  \        V4      4       Wn        R # N)r!   r"   reprr\   )r#   r\   r$   s   &&r   r"   "_WheelFileValidationError.__init__l   s    f&r   c                    < V ^8  d   QhRS[ /# r2   r   )r   r   s   "r   r   r]   p   s     C C# Cr   c                $    R V P                   : R2# )z WheelFileValidationError(issues=)r\   r+   s   &r   __repr__"_WheelFileValidationError.__repr__p   s    1$++BBr   re   )
rM   rN   rO   rP   rQ   r"   rf   rU   rV   rW   rX   s   @@r   rZ   rZ   i   s$     4 C C Cr   rZ   c                   T   a a ] tR t^tt oRtV3R lV 3R lltV3R lR ltRtVtV ;t	# )_WheelFileBadDistInfoz8Raised when a wheel file has issues around `.dist-info`.c                @   < V ^8  d   QhRS[ RS[S[ ,          RS[ RR/# )r   reasonr;   	dist_infor   N)r   r   )r   r   s   "r   r   "_WheelFileBadDistInfo.__annotate__w   s.     # ## ## #3 #SW #r   c               J   < \         SV `  V4       Wn        W n        W0n        R # r_   )r!   r"   rk   r;   rl   )r#   rk   r;   rl   r$   s   &$$$r   r"   _WheelFileBadDistInfo.__init__w   s      "r   c                    < V ^8  d   QhRS[ /# r2   r   )r   r   s   "r   r   rm   }   s     
 
 
r   c                X    V P                    R V P                  : RV P                  : R2# )z (filename=z, dist_info=rd   rk   r;   rl   r+   s   &r   __str___WheelFileBadDistInfo.__str__}   s,    {{m;t}}&7|DNNCUUVW	
r   )rl   r;   rk   )
rM   rN   rO   rP   rQ   r"   rs   rU   rV   rW   rX   s   @@r   ri   ri   t   s!     B# #
 
 
r   ri   c                      a a ] tR t^t oRt]tV3R lV 3R llt]]	V3R lR l4       4       t
]V3R lR l4       t]V3R lR	 l4       tV3R
 lR ltRR/V3R lR lltV3R lR ltRtVtV ;t# )r   zImplements `WheelSource`, for an existing file from the filesystem.

Example usage::

    >>> with WheelFile.open("sampleproject-2.0.0-py3-none-any.whl") as source:
    ...     installer.install(source, destination)
c                8   < V ^8  d   QhRS[ P                  RR/# )r   fr   NzipfileZipFile)r   r   s   "r   r   WheelFile.__annotate__   s     2 2'// 2d 2r   c                   < Wn         VP                  '       g   Q h\        P                  P	                  VP                  4      p\        V4      p\        SV `  VP                  VP                  R7       RV n
        R# )zpInitialize a WheelFile object.

:param f: An open zipfile, which will stay open as long as this object is used.
)r   r   N)_zipfiler;   ospathbasenamer   r!   r"   r   r   _dist_info_dir)r#   rw   r   parsed_namer$   s   &&  r   r"   WheelFile.__init__   sh    
 zzzz77##AJJ/*84''$11 	 	
 .2r   c                2   < V ^8  d   QhRRRS[ R,          /# )r   r   zos.PathLike[str]r   r   )r   )r   r   s   "r   r   r{      s!      * x/D r   c              #     "   \         P                  ! V4      ;_uu_ 4       pV ! V4      x  RRR4       R#   + '       g   i     R# ; i5i)z%Create a wheelfile from a given path.Nrx   )clsr   rw   s   && r   openWheelFile.open   s/      __T""aa&L #"""s   A
6
A
A		A
c                    < V ^8  d   QhRS[ /# r2   r   )r   r   s   "r   r   r{      s     " "s "r   c           
     ~   V P                   e   V P                   # V P                  P                  4        Uu0 uF  qP                  R^4      ^ ,          kK  	  ppV Uu. uF  q3P	                  R4      '       g   K  VNK  	  pp Vw  pTP                  R^4      ^ ,          p\        T4      p\        T P                  4      pYx8w  d#   \        RT P                  P                  TR7      hYPn         T# u upi u upi   \
         d7    \        RT P                  P                  \        \        T4      4      R7      Rhi ; i)r'   N/r)   z6Wheel doesn't contain exactly one .dist-info directoryrr   r(   z7Wheel .dist-info directory doesn't match wheel filename)r   r}   namelistsplitendswithrR   ri   r;   r   sortedrsplitr   r   )	r#   r   top_level_directoriesname
dist_infosr,   di_dnamenorm_di_dnamenorm_file_dnames	   &        r   r,   WheelFile.dist_info_dir   sA    *&&& /3mm.D.D.F!
.FdJJsAq!!.F 	 !
 3
2TmmL6QDD2 	 
	)] !''Q/2)(3+D,=,=>+'P//'  ,;!

  	'O//fZ01 		s   !C1C6;C6C; ;AD<c                0   < V ^8  d   QhRS[ S[,          /# r2   r3   )r   r   s   "r   r   r{      s     
 
T#Y 
r   c                    V P                   pV P                  P                  4        Uu. uFB  pVRR R8w  g   K  V\        P                  ! W!.4      8X  g   K-  V\        V4      ^,           R NKD  	  up# u upi )z2Get names of all files in the dist-info directory.Nr   )r,   r}   r   	posixpathcommonprefixlen)r#   baser   s   &  r   r7   WheelFile.dist_info_filenames   s~     !! ..0
0BCyC " y--tl;; "DTQ!0
 	
 
s   A4A4A4c                &   < V ^8  d   QhRS[ RS[ /# r:   r   )r   r   s   "r   r   r{      s     8 8s 8s 8r   c                    \         P                  ! V P                  V4      pV P                  P	                  V4      P                  R4      # )z;Get contents, from ``filename`` in the dist-info directory.zutf-8)r   joinr,   r}   readdecode)r#   r;   r   s   && r   r=   WheelFile.read_dist_info   s8    ~~d00(;}}!!$'..w77r   validate_contentsTc                $   < V ^8  d   QhRS[ RR/# )r   r   r   N)bool)r   r   s   "r   r   r{      s     G4 G4D G4D G4r   c                   V P                  R4      P                  4       p\        V4       Uu/ uF  q3^ ,          VbK  	  pp. pT P
                  P                  4        EFS  pTP                  RR R8X  d   K  TP                  TP                  R4      pT P                  \        P                  ! T P                  TP                  .4      8X  dd   TP                  P                  R4      R,          R9   d=   Te7   TP                  RT P
                  P                   RTP                   R24       K  Tf:   TP                  RT P
                  P                   R	TP                   R
24       EK  \        P                  ! T!  pTP                  T P                   R28X  dI   TP                   f   TP"                  e*   TP                  RT P
                  P                   R24       EK  TP                   e   TP"                  f7   TP                  RT P
                  P                   RTP                   R24       T'       g   EK  T P
                  P%                  T4      p	TP'                  T	4      '       d   EK  TP                  RT P
                  P                   RTP                   R24       EKV  	  T'       d   \	        T4      hR# u upi   \         d.   p\	        RT P
                  P                   RT: 2.4      ThRp?ii ; i)al  Validate ``RECORD`` of the wheel.

This method should be called before :py:func:`install <installer.install>`
if validation is required.

File names will always be validated against ``RECORD``.

If ``validate_contents`` is true, sizes and hashes of files
will also be validated against ``RECORD``.

:param validate_contents: Whether to validate content integrity.
RECORDz!Unable to retrieve `RECORD` from z: Nr   zIn z, digital signature file z$ is incorrectly contained in RECORD.z, z is not mentioned in RECORDz/RECORDz/, RECORD file incorrectly contains hash / size.z, hash / size of z is not included in RECORDz didn't match RECORDr   )z
RECORD.p7sz
RECORD.jws)r=   
splitlinesr   rL   rZ   r}   r;   infolistpopr,   r   r   r   appendr   from_elementshash_sizer   validate)
r#   r   record_linesrecordrecord_mappingexcr\   itemrecord_argsdatas
   &$        r   rB   WheelFile.validate_record   s   	..x8CCEL0A,0O0Ofq	6!0O   MM**,D}}RS!S((,,T]]DAK!!Y%;%;##T]]3& --%%c*2.2NN*MMdmm4455Nt}}o  ^B  C "$--001DMM?B]^  ..<F}}4#5#5"6g >><<+v{{/FMMdmm4455de ||#v{{':$--0011B4==/Qkl ! }}))$/t,,MMdmm4455Ft}}oUijS -Z +F33 o  	+4T]]5K5K4LBsgVW	s(   ,K K K K L(LLc                0   < V ^8  d   QhRS[ S[,          /# r2   rE   )r   r   s   "r   r   r{   #  s     ; ;h':; ;r   c              #    "   V P                  R4      P                  4       p\        V4      pV Uu/ uF  q3^ ,          VbK  	  ppV P                  P	                  4        F  pVP
                  RR R8X  d   K  VP                  VP
                  VP
                  RR34      pVP                  ^,	          p\        T;'       d(    \        P                  ! V4      ;'       d
    V^I,          4      pV P                  P                  V4      ;_uu_ 4       p\        RV4      p	W9V3x  RRR4       K  	  R# u upi   + '       g   i     K  ; i5i)zSequential access to all contents of the wheel (including dist-info files).

This implementation requires that every file that is a part of the wheel
archive has a corresponding entry in RECORD. If they are not, an
:any:`AssertionError` will be raised.
r   Nr    r   r   )r=   r   r   r}   r   r;   r   external_attrr   statS_ISREGr   r
   )
r#   r   recordsr   r   r   modeis_executablestreamstream_casteds
   &         r   rH   WheelFile.get_contents#  s     **84??A#L1:AB')V+'BMM**,D}}RS!S( $''r27NOF %%+D !M!M$,,t*<!M!MNM##D))V $Z 8]:: *) - C *))s5   /ED2A>EE 1ED7$E7E	E)r   r}   )rM   rN   rO   rP   rQ   rZ   rK   r"   classmethodr   r   rS   r,   r7   r=   rB   rH   rU   rV   rW   rX   s   @@r   r   r      s      12 2    
 " "H 
 
8 8
G44 G4 G4R; ; ;r   )!rQ   r~   r   r   ry   
contextlibr   typingr   r   r   r   r   r   r	   r
   installer.exceptionsr   installer.recordsr   r   installer.utilsr   r   r   r   rF   __all__r   rR   rZ   ri   r   r@   r   r   <module>r      s    / 	    % R R R / < CE#sC-0(D@A  +
&R" R"jC
N C
J 
z; z;r   