j7i dZddlmZddlZddlZddlZddlZddlmZm Z m Z ddl m Z Gdde Z dd Zejdd Zdd Zed k(rddlZej(Zej-d sJdedeedeej0eddeej2ddej5dddD] Zeedyy)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 NamedTupleSequence)ELFFilec"eZdZUded<ded<y) _MuslVersionintmajorminorN)__name__ __module__ __qualname____annotations__]/mnt/ssd/data/python-lab/ChefSystem/venv/lib/python3.12/site-packages/packaging/_musllinux.pyr r s J Jrr c@d|jDDcgc]}|s| }}t|dks |ddddk7rytjd|d}|syt t |j dt |j dScc}w) Nc3<K|]}|jyw)N)strip).0ns r z&_parse_musl_version..s@q@srmuslzVersion (\d+)\.(\d+)r)r r ) splitlineslenrematchr r group)outputrlinesms r_parse_musl_versionr&s@F,=,=,?@ F1AQ FE F 5zA~q"1/ (%(3A  c!''!*oS_ EE Gs BBc* t|d5}t|j}dddd|vryt j|gt jd}t|jS#1swYLxYw#ttt f$rYywxYw)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 rbNrT)stderrtext) openr interpreterOSError TypeError ValueError subprocessrunPIPEr&r)) executablefldprocs r_get_musl_versionr7!s *d # (q''B ( zV2% >>2$zT BD t{{ ++ ( ( Y +s' A;A/A;/A84A;;BBc#Kttj}|y|D]5}t|jddD]}d|j d|d|7yw)aGenerate 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__)r7sysr3ranger r )archssys_muslarchr s r platform_tagsrA8sh!0H?8>>2r2 ?Ex~~.awav> > ??sAA__main__zlinux-z not linuxzplat:zmusl:ztags: )endz[.-]r;-r9z )r#strreturn_MuslVersion | None)r3rFrGrH)r>z Sequence[str]rGz Iterator[str])__doc__ __future__r functoolsr r0r<typingrrr_elffilerr r& lru_cacher7rAr sysconfig get_platformplat startswithprintr3subsplittrrrrWs #  11: F ,,,?& z !9 ! ! #D ??8 $1k1 $ '4 '$S^^45 's 6266'3 30B20FG H! aZ !r