Ë
    ªŒjÖ
  ã            
      óè  — 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	 ddl
mZ erddlmZmZ  G d„ d	e	«      Zdd
„Zej"                  dd„«       Zdd„Zedk(  r—ddlZ ej,                  «       Zej1                  d«      sJ d«       ‚ ede«        ed eej4                  «      «        edd¬«        e ej6                  ddej9                  dd«      d   «      g«      D ]  Z eed¬«       Œ yy)z�PEP 656 support.

This module implements logic to detect if the currently running Python is
linked against musl, and what musl version is used.
é    )ÚannotationsN)ÚTYPE_CHECKINGÚ
NamedTupleé   )ÚELFFile)ÚIteratorÚSequencec                  ó"   — e Zd ZU ded<   ded<   y)Ú_MuslVersionÚintÚmajorÚminorN)Ú__name__Ú
__module__Ú__qualname__Ú__annotations__© ó    ú^/var/www/html/Fitness-lenito-AI-main/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×,=Ñ,=Ô,?Ô@ÓFÑ@�1ÂAŠQÐ@€EÐFÜ
ˆ5ƒz�A‚~˜˜q™ " 1˜¨Ò/ØÜ
�‰Ð(¨%°©(Ó3€AÙØÜœc !§'¡'¨!£*›o´S¸¿¹À»³_ÔEÐEùò Gs
   šB¢Bc                ó,  — 	 t        | d«      5 }t        |«      j                  }ddd«       �d|vryt        j                  |gdt        j                  d¬«      }t        |j                  «      S # 1 sw Y   ŒMx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   FT)ÚcheckÚstderrÚtext)Úopenr   ÚinterpreterÚOSErrorÚ	TypeErrorÚ
ValueErrorÚ
subprocessÚrunÚPIPEr'   r+   )Ú
executableÚfÚldÚprocs       r   Ú_get_musl_versionr9   $   s‚   € ðÜ�*˜dÔ# qÜ˜“×'Ñ'ˆB÷ $ð 
€z�V 2Ñ%ØÜ�>‰>˜2˜$ e´J·O±OÈ$ÔO€DÜ˜tŸ{™{Ó+Ð+÷ $Ð#ûä”Y¤
Ð+ò Ùðús'   ‚A< ŽA0¤A< Á0A9Á5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_Ú_)r9   Úsysr5   Úranger   r   )ÚarchsÚsys_muslÚarchr   s       r   Úplatform_tagsrC   ;   s^   è ø€ ô !¤§¡Ó0€HØÐØÛˆÜ˜8Ÿ>™>¨2¨rÖ2ˆEØ˜xŸ~™~Ð.¨a°¨w°a¸°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)r5   rH   rI   rJ   )r@   zSequence[str]rI   zIterator[str])Ú__doc__Ú
__future__r   Ú	functoolsr!   r2   r>   Útypingr   r   Ú_elffiler   Úcollections.abcr   r	   r   r'   Ú	lru_cacher9   rC   r   Ú	sysconfigÚget_platformÚplatÚ
startswithÚprintr5   ÚsubÚsplitÚtr   r   r   Ú<module>rZ      sõ   ðñõ #ã Û 	Û Û 
ß ,å áß2ô�:ô ó
Fð ×Ñò,ó ð,ó,?ð& ˆzÒÛà!ˆ9×!Ñ!Ó#€DØ�?‰?˜8Ô$Ð1 kÓ1Ð$á	ˆ'�4ÔÙ	ˆ'Ñ$ S§^¡^Ó4Ô5Ù	ˆ'�sÕÙ˜F˜BŸF™F 7¨C°·±¸CÀÓ1CÀBÑ1GÓHÐIÖJˆÙˆa�ZÖ ñ Kð r   