+
     h
  c            
      s   R t ^ RIHt ^ RIt^ RIt^ RIt^ RIt^ RIHtH	t	H
t
 ^RIHt  ! R R]	4      tR R lt]P                  R	 R
 l4       tR R lt]R8X  d   ^ RIt]P(                  ! 4       t]! R]4       ]! R]! ]P.                  4      4       ]! RRR7       ]! ]P0                  ! RR]P3                  R^4      R,          4      4       F  t]! ]RR7       K  	  R# R# )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                  s,    ] tR t^t$ R]R&   R]R&   RtR# )_MuslVersionintmajorminor N)__name__Z
__module__Z__qualname__Z__firstlineno__Z__annotations__Z__static_attributes__r	       9/usr/lib/python3.14/site-packages/packaging/_musllinux.pyr   r      s    JJr   r   c                    V ^8  d   QhRRRR/# )   outputstrreturn_MuslVersion | Noner	   Zformat   "r   __annotate__r      s     F F F(; Fr   c                s   R  V P                  4        4        Uu. uF  q'       g   K  VNK  	  pp\        V4      ^8  g   V^ ,          R,          R8w  d   R# \        P                  ! RV^,          4      pV'       g   R# \	        \        VP                  ^4      4      \        VP                  ^4      4      R7      # u upi )c              3  s@   "   T F  qP                  4       x  K  	  R # 5i)N)Zstrip)Z.0ns   & r   Z	<genexpr>Z&_parse_musl_version.<locals>.<genexpr>   s     @,?q,?s   :Ni   NmuslNzVersion (\d+)\.(\d+))r   r   )Z
splitlinesZlenreZmatchr   r   Zgroup)r   r   ZlinesZm   &   r   _parse_musl_versionr      s    @F,=,=,?@F@1AQQ@EF
5zA~q"/
(%(3Ac!''!*oS_EE Gs
   	B<B<c               r   )r   
executabler   r   r   r	   r   r   r   r   r   "   s     , ,# ,*= ,r   c                s\    \        V R4      ;_uu_ 4       p\        V4      P                  pRRR4       Xe   RT9  d   R# \        P                  ! T.\        P                  RR7      p\        TP                  4      #   + '       g   i     LZ; i  \        \        \
        3 d     R# i ; i)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
ZrbNr   T)stderrZtext)Zopenr   ZinterpreterZOSErrorZ	TypeErrorZ
ValueError
subprocessZrunZPIPEr   r   )r   ZfZldZprocr   r   _get_musl_versionr   !   s    *d##q''B $ 
zV2%>>2$zTBDt{{++ $#Y
+ s-   B A>B >B		B B B+*B+c               r   )r   archszSequence[str]r   zIterator[str]r	   r   r   r   r   r   8   s     ? ? ?= ?r   c              #  s   "   \        \        P                  4      pVf   R# V  F8  p\        VP                  RR4       F  pRVP
                   RV RV 2x  K  	  K:  	  R# 5i)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.
NZ
musllinux__)r   sysr   Zranger   r   )r   Zsys_muslZarchr   r   r   platform_tagsr#   8   s]      !0H8>>2r2Ex~~.awav>> 3 s   A A"Z__main__zplat:zmusl:ztags:Z )Zendz[.-]r    Z-z
      r!   )Z__doc__Z
__future__r    Z	functoolsr   r   r"   Ztypingr   r   r   Z_elffiler   r   r   Z	lru_cacher   r#   r
   Z	sysconfigZget_platformZplatZprintr   ZsubZsplitZtr	   r   r   <module>r$      s    #  	  
 1 1 : 
F , ,,?& z!!#D 
'4	'$S^^45	's266'3

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