U o a\@sNddlmZddlZzddlmZWn0ek rTddlZddeDZ[YnXddl Z ddl Z ddl Z ddl Z ddl Z ddlZddlZddlZddlmZmZerddlmZmZmZmZmZmZmZmZmZmZeeZ eeefZ!eeefZ"e #e$Z%d d d d d dZ&ej'dkZ(Gddde)Z*ddZ+ddZ,dSddZ-ddZ.ddZ/dTddZ0dUdd Z1d!d"Z2dVd#d$Z3d%d&Z4dWd'd(Z5e(fd)d*Z6d+d,Z7dXd-d.Z8d/d0Z9d1d2Z:d3d4Z;d5d6ZGd;d<dZ@d?d@ZAdAdBZBdCdDZCe(fdEdFZDdGdHZEdIdJZFdKdLZGdMdNZHdOdPZIdQdRZJdS)Y)absolute_importN)EXTENSION_SUFFIXEScCsg|] }|dqS)r).0xrr[C:\Users\vtejo\AppData\Local\Temp\pip-unpacked-wheel-6mt8ur68\pip\_vendor\packaging\tags.py sr)MYPY_CHECK_RUNNINGcast) Dict FrozenSetIOIterableIteratorListOptionalSequenceTupleUnionpycpppipjy)pythoncpythonpypy ironpythonjythonlc@sbeZdZdddgZddZeddZedd Zed d Zd d Z ddZ ddZ ddZ dS)Tag _interpreter_abi _platformcCs"||_||_||_dSN)lowerr!r"r#)self interpreterabiplatformrrr__init__@s  z Tag.__init__cCs|jSr$)r!r&rrrr'FszTag.interpretercCs|jSr$)r"r+rrrr(KszTag.abicCs|jSr$)r#r+rrrr)Psz Tag.platformcCs2t|tstS|j|jko0|j|jko0|j|jkSr$) isinstancer NotImplementedr)r(r')r&otherrrr__eq__Us    z Tag.__eq__cCst|j|j|jfSr$)hashr!r"r#r+rrr__hash__`sz Tag.__hash__cCsd|j|j|jS)Nz{}-{}-{})formatr!r"r#r+rrr__str__dsz Tag.__str__cCsdj|t|dS)Nz<{self} @ {self_id}>)r&self_id)r2idr+rrr__repr__hsz Tag.__repr__N) __name__ __module__ __qualname__ __slots__r*propertyr'r(r)r/r1r3r6rrrrr <s     r c Cs`t}|d\}}}|dD]6}|dD]&}|dD]}|t|||qConfig variable '%s' is unset, Python ABI tag may be incorrect) sysconfigget_config_varloggerdebug)namerIvaluerrr_get_config_vars  rZcCs|ddddS)Nr=_r<)replace)stringrrr_normalize_stringsr^cCst|dkot|dkS)zj Determine if the Python version supports abi3. PEP 384 was first implemented in Python 3.2. r ))rJtuple)python_versionrrr _abi3_appliessrcc Cst|}g}t|dd}d}}}td|}ttd}dtk} |sX|dkr\|sX| r\d}|dkrtd|} | sz| dkr~d }|d krtd |} | d ks| dkrtjd krd}n|r|dj|d| ddj||||d|S)Nr`Py_DEBUGgettotalrefcountz_d.pydd)r_ WITH_PYMALLOCm)r_r_Py_UNICODE_SIZEiu cp{version}versionrz"cp{version}{debug}{pymalloc}{ucs4})rprWpymallocucs4) ra_version_nodotrZhasattrsysr maxunicodeappendr2insert) py_versionrIrErprWrqrr with_debug has_refcounthas_ext with_pymalloc unicode_sizerrr _cpython_abissB      rc +s\td|}|stjdd}dt|dd|dkrVt|dkrRt||}ng}t|}dD](}z||Wqbt k rYqbXqbt|pt }|D]}|D]}t ||Vqqt |rfdd|DD] }|Vqևfd d|DD] }|Vqt |rXt |dddd D]8} |D],}d jt|d | fd t d|Vq&qdS)a Yields the tags for a CPython interpreter. The tags consist of: - cp-- - cp-abi3- - cp-none- - cp-abi3- # Older Python versions down to 3.2. If python_version only specifies a major version then user-provided ABIs and the 'none' ABItag will be used. If 'abi3' or 'none' are specified in 'abis' then they will be yielded at their normal position and not at the beginning. cpython_tagsNr`zcp{}r )abi3nonec3s|]}td|VqdS)rNr rrGr'rr szcpython_tags..c3s|]}td|VqdS)rNrrrrrrsrnrror)rSru version_infor2rsrJrlistremove ValueError_platform_tagsr rcrange) rbrErFrQrI explicit_abir(rGrB minor_versionrrrrs<    rccstd}|rt|VdS)NSOABI)rTrUr^)r(rrr _generic_abis rc kstd|}|s,t}t|d}d||g}|dkr:t}t|pDt}t|}d|krb|d|D]}|D]}t|||VqnqfdS)z Yields the tags for a generic interpreter. The tags consist of: - -- The "none" ABI will be added if it was not explicitly provided. generic_tagsrIrdNr) rSinterpreter_nameinterpreter_versionjoinrrrrwr ) r'rErFrQrI interp_nameinterp_versionr(rGrrrr s   rccs|t|dkr&djt|dddVdj|ddVt|dkrxt|ddd d D]}djt|d|fdVqXdS) z Yields Python versions in descending order. After the latest version, the major-only version will be yielded, and then all previous versions of that major version. r z py{version}Nr`roz py{major}r)majorr)rJr2rsr)ryminorrrr_py_interpreter_range(s   rccsx|stjdd}t|pt}t|D]}|D]}t|d|Vq0q(|rXt|ddVt|D]}t|ddVq`dS)z Yields the sequence of tags that are compatible with a specific version of Python. The tags consist of: - py*-none- - -none-any # ... if `interpreter` is provided. - py*-none-any Nr`rany)rurrrrr )rbr'rFrprGrrrcompatible_tags8s  rcCs|s|S|drdSdS)Nppci386) startswith)archis_32bitrrr _mac_archRs  rcCs|g}|dkr,|dkrgS|dddgnp|dkrR|dkr@gS|dddgnJ|dkrz|d ksj|dkrngS|dn"|d kr|d krgS|ddg|d |S) Nx86_64) rlintelfat64fat32rfatppc64)rr)r universal)extendrw)rpcpu_archformatsrrr_mac_binary_formats]s&  rc cst\}}}|dkr:tdttt|ddd}n|}|dkrPt|}n|}t|dddD]>}|d|f}t ||}|D]}dj |d|d|d VqqddS) aD Yields the platform tags for a macOS system. The `version` parameter is a two-item tuple specifying the macOS version to generate platform tags for. The `arch` parameter is the CPU architecture to generate platform tags for. Both parameters default to the appropriate value for the current system. N MacVersionr=r`r rrz&macosx_{major}_{minor}_{binary_format})rr binary_format) r)mac_verr ramapintr?rrrr2) rpr version_strr[rrcompat_versionbinary_formatsrrrr mac_platformsys $   rc Cs>zddl}tt||dWSttfk r4YnXt|S)Nr _compatible) _manylinuxboolgetattr ImportErrorAttributeError_have_compatible_glibc)rX glibc_versionrrrr_is_manylinux_compatibles rcCs tp tSr$)_glibc_version_string_confstr_glibc_version_string_ctypesrrrr_glibc_version_stringsrc CsJz&td}|dk st|\}}Wnttttfk rDYdSX|S)zJ Primary implementation of glibc_version_string using os.confstr. CS_GNU_LIBC_VERSIONN)osconfstrAssertionErrorr?rOSErrorr)version_stringr[rprrrrs  rcCsvz ddl}Wntk r"YdSX|d}z |j}Wntk rNYdSX|j|_|}t|tsr| d}|S)zG Fallback implementation of glibc_version_string using ctypes. rNascii) ctypesrCDLLgnu_get_libc_versionrc_char_prestyper,strdecode)rprocess_namespacerrrrrrs     rcCsHtd|}|s$td|tdSt|d|koFt|d|kS)Nz$(?P[0-9]+)\.(?P[0-9]+)z=Expected glibc version with 2 components major.minor, got: %sFrr)rematchwarningsrIRuntimeWarningrgroup)rrequired_major minimum_minorrjrrr_check_glibc_versions rcCst}|dkrdSt|||SNF)rr)rrrrrrrsrc@sTeZdZGdddeZdZdZdZdZdZ dZ dZ dZ d Z d Zd Zd Zd dZdS)_ELFFileHeaderc@seZdZdZdS)z$_ELFFileHeader._InvalidELFFileHeaderz7 An invalid ELF file header was found. N)r7r8r9__doc__rrrr_InvalidELFFileHeader sriFLEr r`r_(>l~iicsrfdd}|d|_|j|jkr*t|d|_|j|j|jhkrNt|d|_|j|j|j hkrrt|d|_ |d|_ |d|_ d|_|j|jkrdnd}|j|jkrdnd}|j|jkrd nd }|j|jkr|n|}|||_|||_|||_|||_|||_|||_|||_|||_|||_|||_|||_|||_|||_dS) NcsBzt|t|\}Wntjk r<tYnX|Sr$)structunpackreadcalcsizeerrorrr)fmtresultfilerrrs z'_ELFFileHeader.__init__..unpackz>IBzHzQ) e_ident_magicELF_MAGIC_NUMBERrr e_ident_class ELFCLASS32 ELFCLASS64 e_ident_data ELFDATA2LSB ELFDATA2MSBe_ident_version e_ident_osabie_ident_abiversionr e_ident_pade_type e_machine e_versione_entrye_phoffe_shoffe_flagse_ehsize e_phentsizee_phnum e_shentsizee_shnum e_shstrndx)r&rrformat_hformat_iformat_qformat_prrrr*s>                    z_ELFFileHeader.__init__N)r7r8r9rrrrrrrEM_386EM_S390EM_ARM EM_X86_64EF_ARM_ABIMASKEF_ARM_ABI_VER5EF_ARM_ABI_FLOAT_HARDr*rrrrrsrc CsJz$ttjd}t|}W5QRXWn ttttjfk rDYdSX|S)Nrb)openru executablerIOErrorrrOr)f elf_headerrrr_get_elf_headerGs rcCsnt}|dkrdS|j|jk}||j|jkM}||j|jkM}||j|j@|j kM}||j|j @|j kM}|Sr) rrrrrrrrrrrrrrrr_is_linux_armhfQs   rcCsBt}|dkrdS|j|jk}||j|jkM}||j|jkM}|Sr)rrrrrrr rrrr_is_linux_i686es rcCs |dkrtS|dkrtSdS)Narmv7li686T)rr)rrrr_have_compatible_manylinux_abips r ccsttj}|r,|dkr d}n |dkr,d}g}|dd\}}t|rv|dkrZ|d|d krv|d |d t|}|D]$\}}t||r| d |Vqq|D]\}}| d |Vq|VdS) N linux_x86_64 linux_i686 linux_aarch64 linux_armv7lr[r >ppc64les390xrrraarch64r) manylinux2014)r`>rr) manylinux2010)r` ) manylinux1)r`rlinux) r^ distutilsutil get_platformr?r rwrMrr\)rr-manylinux_supportr[rmanylinux_support_iterrXrrrr_linux_platformsys8   r3ccsttjVdSr$)r^r.r/r0rrrr_generic_platformssr4cCs.tdkrtStdkr$tStSdS)z; Provides the platform tags for this installation. DarwinLinuxN)r)systemrr3r4rrrrrs   rcCs<z tjj}Wn tk r,t}YnXt|p:|S)z6 Returns the name of the running interpreter. ) ruimplementationrXrr)python_implementationr%INTERPRETER_SHORT_NAMESget)rXrrrrs  rcKs:td|}td|d}|r$t|}nttjdd}|S)z9 Returns the version of the running interpreter. rpy_version_nodotrNr`)rSrZrrsrur)rQrIrprrrrs    rcCs,tdd|Drd}nd}|tt|S)Ncss|]}|dkVqdS)rNr)rvrrrrsz!_version_nodot..r[rd)rrrr)rpseprrrrssrscksXtd|}t}|dkr0t|dD] }|Vq"ntD] }|Vq6tD] }|VqHdS)z Returns the sequence of tag triples for the running interpreter. The order of the sequence corresponds to priority order for the interpreter, from most to least important. sys_tagsrrN)rSrrrr)rQrIrrBrrrr?s    r?)F)F)NNN)NNN)NNN)NN)K __future__rdistutils.utilr.importlib.machineryrrimpZ get_suffixesloggingrr)rrrurTr_typingr r typingr r rrrrrrrrrZ PythonVersionrZ GlibcVersion getLoggerr7rVr:maxsize_32_BIT_INTERPRETERobjectr rHrSrZr^rcrrrrrrrrrrrrrrrrrrrr r3r4rrrrsr?rrrrs 0     1   & <    # @   !