+
    VBi0                        R t ^ RIt^ RIt^ RIt^ RIt^ RI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 ^ RIHtHtHtHtHtHtHtHtHtHt ^ RIHt ]'       d	   ^ R	I H!t!H"t" ]! R
]#4      t$]]$R3,          t%. R%Ot&]PN                  R8H  t(]('       d   R&MR't)]PT                  ! R]PV                  ]PX                  ,          4      t-]
! R. R(O4      t.]PT                  ! R]PV                  ]PX                  ,          4      t/]! ]%R)4      t0R R lt1R R lt2R R lt3R R lt4R R lt5]Pl                  R R l4       t7R 3R R llt8R R  lt9R! R" lt:R# R$ lt;R# )*z=Utilities related to handling / interacting with wheel files.N)
namedtuple)ConfigParser)Message)
FeedParser)compat32)
TYPE_CHECKINGBinaryIOCallableIterableIteratorNewTypeOptionalTupleUnioncast)RecordEntry)LauncherKindScriptSectionScheme.WheelFilenamentz
    ^
    (?P<distribution>.+?)
    -(?P<version>.*?)
    (?:-(?P<build_tag>\d[^-]*?))?
    -(?P<tag>.+?-.+?-.+?)
    \.whl
    $
    zZ
    (?P<module>[\w.]+)\s*
    (:\s*(?P<attrs>[\w.]+))\s*
    (?P<extras>\[.*\])?\s*$
    c                0    V ^8  d   QhR\         R\        /# )   contentsreturn)strr   )formats   "4/usr/lib/python3.14/site-packages/installer/utils.py__annotate__r   U   s     
 
# 
' 
    c                d    \        \        R7      pVP                  V 4       VP                  4       # )zParse :pep:`376` ``PKG-INFO``-style metadata files.

``METADATA`` and ``WHEEL`` files (as per :pep:`427`) use the same syntax
and can also be parsed using this function.

:param contents: The entire contents of the file
)policy)r   r   feedclose)r   feed_parsers   & r   parse_metadata_filer%   U   s+     H-KXr   c                0    V ^8  d   QhR\         R\         /# )r   namer   )r   )r   s   "r   r   r   b   s     0 0C 0C 0r   c                N    \         P                  ! RRV 4      P                  4       # )zaCanonicalize a project name according to PEP-503.

:param name: The project name to canonicalize
z[-_.]+-)resublower)r'   s   &r   canonicalize_namer-   b   s     
 66)S$'--//r   c                0    V ^8  d   QhR\         R\        /# )r   filenamer   )r   r   )r   s   "r   r   r   j   s     / /3 /= /r   c                    \         P                  V 4      pV'       g   \        RV  24      h\        VP	                  4       !  # )z^Parse a wheel filename, into it's various components.

:param filename: The filename to parse
zNot a valid wheel filename: )_WHEEL_FILENAME_REGEXmatch
ValueErrorr   groups)r/   
wheel_infos   & r   parse_wheel_filenamer6   j   s>    
 ',,X6J7zBCC*++-..r   c          
      j    V ^8  d   QhR\         R\         R\        R\        \        \        3,          /# )r   sourcedesthash_algorithmr   )r   r   r   int)r   s   "r   r   r   u   s>     W WW
W W 38_	Wr   c                d   \         P                  ! V4      p^ p V P                  \        4      pV'       g   M6VP	                  V4       VP                  V4       V\        V4      ,          pKU  \        P                  ! VP                  4       4      P                  R4      P                  R4      V3# )ag  Copy a buffer while computing the content's hash and size.

Copies the source buffer into the destination buffer while computing the
hash of the contents. Adapted from :any:`shutil.copyfileobj`.

:param source: buffer holding the source data
:param dest: destination buffer
:param hash_algorithm: hashing algorithm

:return: size, hash digest of the contents
ascii=)hashlibnewread_COPY_BUFSIZEupdatewritelenbase64urlsafe_b64encodedigestdecoderstrip)r8   r9   r:   hashersizebufs   &&&   r   copyfileobj_with_hashingrN   u   s      [[(FD
kk-(c

3C##FMMO4;;GDKKCPRVVVr   c                    V ^8  d   QhRR/# )r   r   r    )r   s   "r   r   r      s     H H> Hr   c                 R   \         P                  R8w  d   R# R\        P                  P	                  4       9   d   R# R\        P                  P	                  4       9   d   R# R\        P                  P	                  4       9   d   R# \        P
                  R	8X  d   R
# \        R4      h)z.Get the launcher kind for the current machine.r   posixamd64z	win-amd64z(arm64)z	win-arm64z(arm)zwin-armwin32zwin-ia32z&Unknown launcher kind for this machine)osr'   sysversionr,   platformNotImplementedErrorrP   r   r   get_launcher_kindrZ      ss    	ww$#++##%%CKK%%''#++##%%
||w
F
GGr   c                R    V ^8  d   QhR\         R\        R\        \         ,          /# )r   streaminterpreterr   )r   r   r   )r   s   "r   r   r      s&       s x7I r   c              #    "   V P                  ^ 4       V P                  ^4      R8X  d   \        P                  ! 4       pVP	                  RV R2P                  4       4       V P                  ^ 4       V P                  4         V P                  \        4      pV'       g   MVP	                  V4       K2  VP                  ^ 4       Vx  VP                  4        R# V P                  ^ 4       V x  R# 5i)zReplace ``#!python`` shebang in a stream with the correct interpreter.

:param stream: stream to modify
:param interpreter: "correct interpreter" to substitute the shebang with

:returns: A context manager, that provides an appropriately modified stream.
s   #!pythonz#!
N)	seekrA   ioBytesIOrD   encodereadlinerB   r#   )r\   r]   
new_streamrM   s   &&  r   fix_shebangrf      s      KKN{{1~$ZZ\
2k]"-4467A++m,CS!As   BC3!AC3c                     R # )NrP   )_s   &r   <lambda>ri      s    Tr   c                    V ^8  d   QhR\         \        \        \        3,          ,          R\        \        .\
        \        ,          3,          R\        /# )r   recordsprefix_for_schemer   )r
   r   r   r   r	   r   r   r   )r   s   "r   r   r      sE      eFK/01(3- 78 r   c                4   \         P                  ! \         P                  ! 4       RRRR7      p\        P                  ! VRRRR7      pV  F+  w  rEVP                  VP                  V! V4      4      4       K-  	  VP                  ^ 4       VP                  4       # )	a'  Construct a RECORD file.

:param records:
    ``records`` as passed into :any:`WheelDestination.finalize_installation`
:param prefix_for_scheme:
    function to get a prefix to add for RECORD entries, within a scheme

:return: A stream that can be written to file. Must be closed by the caller.
zutf-8T )encodingwrite_throughnewline,"r_   )	delimiter	quotecharlineterminator)	ra   TextIOWrapperrb   csvwriterwriterowto_rowr`   detach)rk   rl   r\   ry   schemerecords   &&    r   construct_record_filer      sw     


wdBF ZZ#TRF!&7&?@A "
KKN==?r   c          	      t    V ^8  d   QhR\         R\        \        \         \         \         R3,          ,          /# )r   textr   r   )r   r
   r   )r   s   "r   r   r      s-     6 6C 6HU3S/3Q-R$S 6r   c           
   #  .  "   \        RR7      p\        Vn        VP                  V 4       VP	                  4        F  pVR9  d   K  VP                  V4       F  w  r4\        V\        4      '       g   Q h\        P                  V4      pV'       g   Q hVP                  R4      p\        V\        4      '       g   Q hVP                  R4      pVf   Q h\        V\        4      '       g   Q h\        RVR\        R4      )  4      pW6Wx3x  K  	  K  	  R# 5i)	zParse ``entry_points.txt``-style files.

:param text: entire contents of the file
:return:
    name of the script, module to use, attribute to call, kind of script (cli / gui)
r>   )
delimitersmoduleattrsNr   _scripts)console_scriptsgui_scripts)r   r   optionxformread_stringsectionsitems
isinstance_ENTRYPOINT_REGEXr2   groupr   rE   )	r   configsectionr'   valuer2   r   r   script_sections	   &        r   parse_entrypointsr      s      S)FF
t??$<<!<<0KDdC((((%++E2EL5[[*Ffc****KK(E$$$eS))))!/7;Mc*o=M3NON55 1	 %s   BDBDc                $    V ^8  d   QhR\         /# )r   r   )r;   )r   s   "r   r   r      s       r   c                 ^    \         P                  ! ^ 4      p \         P                  ! V 4       V # )zBGet the current umask which involves having to set it temporarily.)rU   umask)masks    r   _current_umaskr      s    88A;DHHTNKr   c                B    V ^8  d   QhR\         \        R3,          RR/# )r   pathzos.PathLike[str]r   N)r   r   )r   s   "r   r   r     s%     8 8uS*<%<= 8$ 8r   c                b    \         P                  ! V R\        4       ( ,          ^I,          4       R# )z.Make the file at the provided path executable.i  N)rU   chmodr   )r   s   &r   make_file_executabler     s     HHTE^---57r   )
r%   r6   rN   rZ   rf   r   r   r   r   SCHEME_NAMESi   i   )distributionrW   	build_tagtag)purelibplatlibheadersscriptsdata)<__doc__rF   
contextlibrx   r?   ra   rU   r*   rV   collectionsr   configparserr   email.messager   email.parserr   email.policyr   typingr   r   r	   r
   r   r   r   r   r   r   installer.recordsr   installer.scriptsr   r   r   r   
AllSchemes__all__r'   _WINDOWSrB   compileVERBOSEUNICODEr1   r   r   r   r%   r-   r6   rN   rZ   contextmanagerrf   r   r   r   r   rP   r   r   <module>r      sC   C   
  	 	 	 
 " % ! # !   *=	3	63;
 77d?'Y 

 JJ  D
 JJ
 JJ  J TU
0/W:H"  > <J.6D8r   