
    "h
              
         d Z ddlmZ ddlZddlZddlZddlZddlmZm	Z	m
Z
 ddlmZ  G d de	      Zdd	Zej                  dd
       ZddZedk(  rddlZ ej(                         Zej-                  d      sJ d        ede        ed eej0                                edd        e ej2                  ddej5                  dd      d               D ]  Z eed        yy)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                  "    e Zd ZU ded<   ded<   y)_MuslVersionintmajorminorN)__name__
__module____qualname____annotations__     V/var/www/html/Resume-Scraper/venv/lib/python3.12/site-packages/packaging/_musllinux.pyr
   r
      s    JJr   r
   c                @   d | j                         D        D cg c]  }|s|	 }}t        |      dk  s|d   d d dk7  ry t        j                  d|d         }|sy t	        t        |j                  d            t        |j                  d                  S c c}w )	Nc              3  <   K   | ]  }|j                           y w)N)strip).0ns     r   	<genexpr>z&_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,=,=,?@F1AQFEF
5zA~q"1/
(%(3Ac!''!*oS_EE Gs
   BBc                *   	 t        | d      5 }t        |      j                  }ddd       d|vryt        j                  |gt        j                  d      }t        |j                        S # 1 sw Y   LxY w# t        t        t
        f$ r Y yw xY w)a`  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_versionr7   !   s    *d# 	(q''B	( 
zV2%>>2$zTBDt{{++	( 	(Y
+ s'   A; A/A; /A84A; ;BBc              #     K   t        t        j                        }|y| D ]5  }t        |j                  dd      D ]  }d|j
                   d| d|   7 yw)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__)r7   sysr3   ranger   r   )archssys_muslarchr   s       r   platform_tagsrA   8   sh      !0H ?8>>2r2 	?Ex~~.awav>>	??s   AA__main__zlinux-z	not linuxzplat:zmusl:ztags: )endz[.-]r;   -r9   z
      )r#   strreturn_MuslVersion | None)r3   rF   rG   rH   )r>   zSequence[str]rG   zIterator[str])__doc__
__future__r   	functoolsr    r0   r<   typingr   r   r   _elffiler   r
   r&   	lru_cacher7   rA   r   	sysconfigget_platformplat
startswithprintr3   subsplittr   r   r   <module>rW      s    #  	  
 1 1 : 
F , ,,?& z!9!!#D??8$1k1	'4	'$S^^45	's6266'3

30B20FGH !aZ ! r   