+
    i]/                     @   R t ^ RIt^ RIt^ RIt^ RIHt ^ RIHt ^ RIH	t	 ^ RI
Ht ^ RIHtHtHtHt ^ RIHt ^ RIHtHtHt ^ R	IHtHt ]'       d   ^ RI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Iterator)contextmanager)cached_property)Path)TYPE_CHECKINGBinaryIOClassVarcast)InstallerError)InvalidRecordEntryRecordEntryparse_record_file)canonicalize_nameparse_wheel_filename	WheelFileWheelSourcec                      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       t	]V3R lR l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   "B/root/miniconda3/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 ^8  d   QhRS[ /# r   r   r   )r   r   s   "r   r   r   7   s     ? ?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_dir6   s"     ##$Adll^:>>r    c                    < V ^8  d   QhRS[ /# r(   r   )r   r   s   "r   r   r   <   s     : :# :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(   listr   )r   r   s   "r   r   r   A   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_filenames@   s
     "!r    c                &   < V ^8  d   QhRS[ RS[ /# r   filenamer   r   )r   r   s   "r   r   r   K   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
r9   )r$   r?   s   &&r   read_dist_infoWheelSource.read_dist_infoK   s
     "!r    c                   < V ^8  d   QhRR/# )r   r   N )r   r   s   "r   r   r   W   s     " " "r    c                    \         h)zValidate ``RECORD`` of the wheel.

.. versionadded:: 0.7.0

This method should be called before :py:func:`install <installer.install>`
if validation is required.
r9   r.   s   &r   validate_recordWheelSource.validate_recordW   s
     "!r    c                0   < V ^8  d   QhRS[ S[,          /# r(   r   WheelContentElement)r   r   s   "r   r   r   a   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.
r9   r.   s   &r   get_contentsWheelSource.get_contentsa   s
    . "!r    c                F   < V ^8  d   Qh/ S[ S[S[,          ,          ;R&   # )r   validation_error)r	   type	Exception)r   r   s   "r   r   r      s      tI/< r    r-   )__name__
__module____qualname____firstlineno____doc__
ValueErrorrO   r#   propertyr/   r3   r;   rA   rF   rL   __annotate_func____static_attributes____classdictcell____classcell__r%   r   s   @@r   r   r      s     
 3=  ? ? : : " "
" 
"" "" "G  r    c                   T   a a ] tR t^{t 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   Nr6   )r   r   s   "r   r   &_WheelFileValidationError.__annotate__~   s      tCy T r    c                D   < \         SV `  \        V4      4       Wn        R # N)r"   r#   reprra   )r$   ra   r%   s   &&r   r#   "_WheelFileValidationError.__init__~   s    f&r    c                    < V ^8  d   QhRS[ /# r(   r   )r   r   s   "r   r   rb      s     C C# Cr    c                $    R V P                   : R2# )z WheelFileValidationError(issues=)ra   r.   s   &r   __repr__"_WheelFileValidationError.__repr__   s    1$++BBr    rj   )
rR   rS   rT   rU   rV   r#   rk   rZ   r[   r\   r]   s   @@r   r_   r_   {   s$     4 C C Cr    r_   c                   T   a a ] tR t^t 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[ R,          RS[ RR/# )r   reasonr?   N	dist_infor   r   )r   r   s   "r   r   "_WheelFileBadDistInfo.__annotate__   s.     # ## #t # #PT #r    c               J   < \         SV `  V4       Wn        W n        W0n        R # rd   )r"   r#   rp   r?   rq   )r$   rp   r?   rq   r%   s   &$$$r   r#   _WheelFileBadDistInfo.__init__   s      "r    c                    < V ^8  d   QhRS[ /# r(   r   )r   r   s   "r   r   rr      s     
 
 
r    c                X    V P                    R V P                  : RV P                  : R2# )z (filename=z, dist_info=ri   rp   r?   rq   r.   s   &r   __str___WheelFileBadDistInfo.__str__   s,    {{m;t}}&7|DNNCUUVW	
r    )rq   r?   rp   )
rR   rS   rT   rU   rV   r#   rx   rZ   r[   r\   r]   s   @@r   rn   rn      s!     B# #
 
 
r    rn   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     
 
'// 
d 
r    c                   < Wn         VP                  '       g   Q h\        VP                  4      P                  p\	        V4      p\
        SV `  VP                  VP                  R7       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?   r   namer   r"   r#   r   r   )r$   r|   basenameparsed_namer%   s   &&  r   r#   WheelFile.__init__   sZ    
 zzzz

#((*84''$11 	 	
r    c                2   < V ^8  d   QhRRRS[ R,          /# )r   pathz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.Nr}   )clsr   r|   s   && r   openWheelFile.open   s/      __T""aa&L #"""s   A
6
A
A		A
c                    < V ^8  d   QhRS[ /# r(   r   )r   r   s   "r   r   r      s      s r    c           
     >   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T# u upi u upi   \         d7    \        RT P                   P                  \        \        T4      4      R7      Rhi ; i)r*   /r,   z6Wheel doesn't contain exactly one .dist-info directoryrw   Nr+   z7Wheel .dist-info directory doesn't match wheel filename)r   namelistsplitendswithrW   rn   r?   r   sortedrsplitr   r   )	r$   r   top_level_directoriesr   
dist_infosr/   di_dnamenorm_di_dnamenorm_file_dnames	   &        r   r/   WheelFile.dist_info_dir   s!    /3mm.D.D.F!
.FdJJsAq!!.F 	 !
 3
2TmmL6QDD2 	 
	)] !''Q/2)(3+D,=,=>+'P//'  9!

  	'O//fZ01 		s   !CC!C*C ADc                0   < V ^8  d   QhRS[ S[,          /# r(   r6   )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   r;   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   rA   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     O4 O4D O4D O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Fm  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R4      ;_uu_ 4       pTP+                  \-        RT4      4      '       g7   TP                  RT P
                  P                   RTP                   R24       RRR4       EKp  	  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  \          dX   p	T	P"                   F;  p
TP                  RT P
                  P                   RTP                   RT
 24       K=  	   Rp	?	EK$  Rp	?	ii ; i  + '       g   i     EK>  ; 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, entry in RECORD file for z is invalid: z/RECORDz/, RECORD file incorrectly contains hash / size.z, hash / size of z is not included in RECORDrr   z didn't match RECORDr   )z
RECORD.p7sz
RECORD.jws)rA   
splitlinesr   rQ   r_   r   r?   infolistpopr/   r   r   r   appendr   from_elementsr   ra   hash_sizer   validate_streamr
   )r$   r   record_linesrecordrecord_mappingexcra   itemrecord_argseissuestreams   &$          r   rF   WheelFile.validate_record   s9   	..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]^ $22K@ }}4#5#5"6g >><<+v{{/FMMdmm4455de ||#v{{':$--0011B4==/Qkl ! ]]''c22f!11$z62JKK!$--"8"8!99J4==/Ymn 32_ -j +F33   	+4T]]5K5K4LBsgVW	@ & XXEMMdmm4455P==/ug? &
 , 322sN   ,K* K% K* 0L%+AN
%K* *L"5(LL"%N0ANN
Nc                0   < V ^8  d   QhRS[ S[,          /# r(   rI   )r   r   s   "r   r   r   8  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   )rA   r   r   r   r   r?   r   external_attrr   statS_ISREGr   r
   )
r$   r   recordsr   r   r   modeis_executabler   stream_casteds
   &         r   rL   WheelFile.get_contents8  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   )rR   rS   rT   rU   rV   r_   rO   r#   classmethodr   r   r   r/   rX   r;   rA   rF   rL   rZ   r[   r\   r]   s   @@r   r   r      s      1
 
   
  @ 
 
8 8
O44 O4 O4b; ; ;r    )%rV   r   r   r~   collections.abcr   
contextlibr   	functoolsr   pathlibr   typingr   r   r	   r
   installer.exceptionsr   installer.recordsr   r   r   installer.utilsr   r   ostupler   r   rJ   __all__r   rW   r_   rn   r   rD   r    r   <module>r      s    /    $ % %   0 P P CE#sC-0(D@A  
&Z" Z"zC
N C
J 
}; };r    