
    q"h
              
         S r SSKJr  SSKrSSKrSSKrSSKrSSKJrJ	r	J
r
  SSKJr   " S S\	5      rSS	 jr\R                  SS
 j5       rSS jr\S:X  a  SSKr\R(                  " 5       r\R-                  S5      (       d   S5       e\" S\5        \" S\" \R0                  5      5        \" SSS9  \" \R2                  " SS\R5                  SS5      S   5      5       H
  r\" \SS9  M     gg)zPEP 656 support.

This module implements logic to detect if the currently running Python is
linked against musl, and what musl version is used.
    )annotationsN)Iterator
NamedTupleSequence   )ELFFilec                  *    \ rS rSr% S\S'   S\S'   Srg)_MuslVersion   intmajorminor N)__name__
__module____qualname____firstlineno____annotations____static_attributes__r       R/var/www/html/env/lib/python3.13/site-packages/pip/_vendor/packaging/_musllinux.pyr
   r
      s    JJr   r
   c                Z   S U R                  5        5        Vs/ s H  o(       d  M  UPM     nn[        U5      S:  d  US   S S S:w  a  g [        R                  " SUS   5      nU(       d  g [	        [        UR                  S5      5      [        UR                  S5      5      S9$ s  snf )	Nc              3  @   #    U  H  oR                  5       v   M     g 7f)N)strip).0ns     r   	<genexpr>&_parse_musl_version.<locals>.<genexpr>   s     @,?q,?s      r      muslzVersion (\d+)\.(\d+)r   )r   r   )
splitlineslenrematchr
   r   group)outputr   linesms       r   _parse_musl_versionr*      s    @F,=,=,?@F@1AQ@EF
5zA~q"1/
(%(3Ac!''!*oS_EE Gs
   
B(B(c                8    [        U S5       n[        U5      R                  nSSS5        Wb  SU;  a  g[        R                  " U/[        R                  SS9n[        UR                  5      $ ! , (       d  f       NR= f! [        [        [
        4 a     gf = f)aD  Detect currently-running musl runtime version.

This is done by checking the specified executable's dynamic linking
information, and invoking the loader to parse its output for a version
string. If the loader is musl, the output would be something like::

    musl libc (x86_64)
    Version 1.2.2
    Dynamic Program Loader
rbNr!   T)stderrtext)openr   interpreterOSError	TypeError
ValueError
subprocessrunPIPEr*   r-   )
executablefldprocs       r   _get_musl_versionr;   !   s    *d#q''B $ 
zV2%>>2$zTBDt{{++ $#Y
+ s-   B A0B 0
A>:B >B BBc              #     #    [        [        R                  5      nUc  gU  H8  n[        UR                  SS5       H  nSUR
                   SU SU 3v   M     M:     g7f)a  Generate musllinux tags compatible to the current platform.

:param archs: Sequence of compatible architectures.
    The first one shall be the closest to the actual architecture and be the part of
    platform tag after the ``linux_`` prefix, e.g. ``x86_64``.
    The ``linux_`` prefix is assumed as a prerequisite for the current platform to
    be musllinux-compatible.

:returns: An iterator of compatible musllinux tags.
N
musllinux__)r;   sysr7   ranger   r   )archssys_muslarchr   s       r   platform_tagsrE   8   s]      !0H8>>2r2Ex~~.awav>> 3 s   AA__main__zlinux-z	not linuxzplat:zmusl:ztags: )endz[.-]r?   -r=   z
      )r'   strreturn_MuslVersion | None)r7   rJ   rK   rL   )rB   zSequence[str]rK   zIterator[str])__doc__
__future__r   	functoolsr$   r4   r@   typingr   r   r   _elffiler   r
   r*   	lru_cacher;   rE   r   	sysconfigget_platformplat
startswithprintr7   subsplittr   r   r   <module>r[      s    #  	  
 1 1 : 
F , ,,?& z!!#D??8$$1k1$	'4	'$S^^45	's266'3

30B20FGHaZ  I r   