
    M&i	              
       H   d 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ed	ee         fd
Z ej                    ded	ee         fd            Zded	ee         fdZedk    rddlZ ej                    Ze                    d          s
J d             ede            ed eej                              edd            e ej        dde                    dd          d                             D ]Z eed           dS dS )zPEP 656 support.

This module implements logic to detect if the currently running Python is
linked against musl, and what musl version is used.
    N)Iterator
NamedTupleOptional   )ELFFilec                   $    e Zd ZU eed<   eed<   dS )_MuslVersionmajorminorN)__name__
__module____qualname__int__annotations__     a/home/geonatureadmin/si_en_reseau/tutos/venv/lib/python3.11/site-packages/packaging/_musllinux.pyr	   r	      s"         JJJJJJJJr   r	   outputreturnc                    d d |                                  D             D             }t          |          dk     s|d         d d         dk    rd S t          j        d|d                   }|sd S t	          t          |                    d                    t          |                    d                    	          S )
Nc                     g | ]}||S r   r   .0ns     r   
<listcomp>z'_parse_musl_version.<locals>.<listcomp>   s    FFF1AFQFFFr   c              3   >   K   | ]}|                                 V  d S )N)stripr   s     r   	<genexpr>z&_parse_musl_version.<locals>.<genexpr>   s*      @@q@@@@@@r      r      muslzVersion (\d+)\.(\d+)r   )r
   r   )
splitlineslenrematchr	   r   group)r   linesms      r   _parse_musl_versionr)      s    FF@@F,=,=,?,?@@@FFFE
5zzA~~q"1"//t
(%(33A tc!''!**ooS__EEEEr   
executablec                 6   	 t          | d          5 }t          |          j        }ddd           n# 1 swxY w Y   n# t          t          t
          f$ r Y dS w xY w|d|vrdS t          j        |gt          j        d          }t          |j
                  S )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universal_newlines)openr   interpreterOSError	TypeError
ValueError
subprocessrunPIPEr)   r-   )r*   fldprocs       r   _get_musl_versionr:      s    *d## 	(q'B	( 	( 	( 	( 	( 	( 	( 	( 	( 	( 	( 	( 	( 	( 	(Y
+   tt	zV2%%t>2$z4PPPDt{+++s'   ? 3? 7? 7? AAarchc              #      K   t          t          j                  }|dS t          |j        dd          D ]}d|j         d| d|  V  dS )aT  Generate musllinux tags compatible to the current platform.

    :param arch: Should 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:   sysr*   ranger   r
   )r;   sys_muslr   s      r   platform_tagsrC   6   sr       !00Hx~r2.. ; ;:8>::E::D::::::; ;r   __main__zlinux-z	not linuxzplat:zmusl:ztags: )endz[.-]r?   -r=   z
      )__doc__	functoolsr$   r4   r@   typingr   r   r   _elffiler   r	   strr)   	lru_cacher:   rC   r   	sysconfigget_platformplat
startswithprintr*   subsplittr   r   r   <module>rV      s        				     



 1 1 1 1 1 1 1 1 1 1          :   
F F(> F F F F ,# ,(<*@ , , , ,,; ; ; ; ; ;  z!9!##D??8$$11k111	E'4	E'$$S^44555	E's]626'3

30B0B20FGGHH ! !aZ      ! !r   