ó `8(Zc@@sdZddlmZddlZddlZddlZddlZddlZddl Z ddl m Z ddl m Z ejdƒZd„Zd „Zd „Zd „Zd „Zeed „Zd„Zd„Zd„Zd„Zd„Zdedddd„ZeƒZdS(s2Generate and work with PEP 425 Compatibility Tags.i(tabsolute_importN(t OrderedDicti(tglibcs(.+)_(\d+)_(\d+)_(.+)cC@sEytj|ƒSWn-tk r@}tjdj|ƒtƒdSXdS(Ns{}(t sysconfigtget_config_vartIOErrortwarningstwarntformattRuntimeWarningtNone(tvarte((s9/tmp/pip-build-0nEYGB/setuptools/setuptools/pep425tags.pyRs cC@sUttdƒrd}n9tjjdƒr3d}ntjdkrKd}nd}|S(s'Return abbreviated implementation name.tpypy_version_infotpptjavatjytclitiptcp(thasattrtsystplatformt startswith(tpyimpl((s9/tmp/pip-build-0nEYGB/setuptools/setuptools/pep425tags.pyt get_abbr_impls   cC@sDtdƒ}| s"tƒdkr@djtttƒƒƒ}n|S(sReturn implementation version.tpy_version_nodotRt(RRtjointmaptstrtget_impl_version_info(timpl_ver((s9/tmp/pip-build-0nEYGB/setuptools/setuptools/pep425tags.pyt get_impl_ver(s cC@sKtƒdkr/tjdtjjtjjfStjdtjdfSdS(sQReturn sys.version_info-like tuple for use in decrementing the minor version.RiiN(RRt version_infoR tmajortminor(((s9/tmp/pip-build-0nEYGB/setuptools/setuptools/pep425tags.pyR0s cC@sdjtƒtƒƒS(s; Returns the Tag for this specific implementation. s{}{}(RRR!(((s9/tmp/pip-build-0nEYGB/setuptools/setuptools/pep425tags.pyt get_impl_tag;scC@sNt|ƒ}|dkrD|r=tjdj|ƒtdƒn|ƒS||kS(sgUse a fallback method for determining SOABI flags if the needed config var is unset or unavailable.s?Config variable '{0}' is unset, Python ABI tag may be incorrectiN(RR RRRR (R tfallbacktexpectedRtval((s9/tmp/pip-build-0nEYGB/setuptools/setuptools/pep425tags.pytget_flagBs   c @smtdƒ}tƒ‰| r ˆddhkr ttdƒr d}d}d}tdd„dˆdkƒrvd }ntd ‡fd †dˆdkƒr£d }ntd d„dddˆdkoÐtjdkƒrîtjdkrîd}ndˆtƒ|||f}n\|r<|jdƒr<d|jdƒd}n-|rc|j ddƒj ddƒ}nd}|S(sXReturn the ABI tag based on SOABI (if available) or emulate SOABI (CPython 2, PyPy).tSOABIRRt maxunicodeRtPy_DEBUGcS@s ttdƒS(Ntgettotalrefcount(RR(((s9/tmp/pip-build-0nEYGB/setuptools/setuptools/pep425tags.pytXsRtdt WITH_PYMALLOCc@s ˆdkS(NR(((timpl(s9/tmp/pip-build-0nEYGB/setuptools/setuptools/pep425tags.pyR.\stmtPy_UNICODE_SIZEcS@s tjdkS(Niÿÿ(RR+(((s9/tmp/pip-build-0nEYGB/setuptools/setuptools/pep425tags.pyR.`sR'iitus %s%s%s%s%sscpython-t-it.t_(ii(iiN( RRRRR)R"R!RtsplittreplaceR (tsoabiR/R2R4tabi((R1s9/tmp/pip-build-0nEYGB/setuptools/setuptools/pep425tags.pyt get_abi_tagNs8  (      !cC@s tjdkS(Niÿÿÿ(Rtmaxsize(((s9/tmp/pip-build-0nEYGB/setuptools/setuptools/pep425tags.pyt_is_running_32bitpscC@sÓtjdkrŠtjƒ\}}}|jdƒ}|dkrQtƒrQd}n|dkrotƒrod}ndj|d|d |ƒStjjƒj dd ƒj d d ƒ}|d krÏtƒrÏd }n|S(s0Return our platform name 'win32', 'linux_x86_64'tdarwinR6tx86_64ti386tppc64tppcsmacosx_{}_{}_{}iiR7R5t linux_x86_64t linux_i686( RRtmac_verR8R>Rt distutilstutilt get_platformR9(treleaseR7tmachinet split_vertresult((s9/tmp/pip-build-0nEYGB/setuptools/setuptools/pep425tags.pyRIts  ' cC@s`tƒddhkrtSyddl}t|jƒSWnttfk rOnXtjddƒS(NRDREiii( RItFalset _manylinuxtbooltmanylinux1_compatiblet ImportErrortAttributeErrorRthave_compatible_glibc(RO((s9/tmp/pip-build-0nEYGB/setuptools/setuptools/pep425tags.pytis_manylinux1_compatibleŽs c@s¾g}‡‡fd†‰tdd fdd fdd fd dfgƒ‰ˆ|||ƒrj|j|ƒnx@ˆD]8}|ˆ|krqˆ|||ƒrq|j|ƒqqqqW|jd ƒ|S(sŒReturn a list of supported arches (including group arches) for the given major, minor and machine architecture of an macOS machine. c@s®|dkr||fdkS|dkr8||fd kS|dkrT||fd kS|dkrp||fd kS|ˆkrªx+ˆ|D]}ˆ|||ƒr‡tSq‡WntS( NRCi iRBRAiR@(i i(i i(i i(i i(tTrueRN(R#R$tarchtgarch(t_supports_archtgroups(s9/tmp/pip-build-0nEYGB/setuptools/setuptools/pep425tags.pyRY¥s      tfatRARCtintelR@tfat64RBtfat32t universal(si386sppc(sx86_64si386(sx86_64sppc64(sx86_64si386sppc(Rtappend(R#R$RKtarchesRX((RYRZs9/tmp/pip-build-0nEYGB/setuptools/setuptools/pep425tags.pytget_darwin_archesŸs$    " cC@síg}|dkrug}tƒ}|d }xGt|dddƒD],}|jdjtt||fƒƒƒqBWn|ptƒ}g} |p–tƒ}|r²|g| dd+nt ƒ} ddl } xK| j ƒD]=} | dj dƒrÔ| j | djddƒdƒqÔqÔW| jtt| ƒƒƒ| jd ƒ|s6|pMtƒ} | j d ƒrtj| ƒ}|r|jƒ\}}}}d j||ƒ}g}xjttt|ƒdƒƒD]@}x7tt|ƒ||ƒD]}|j|||fƒqàWqÁWqM| g}n9|dkrDtƒrD| jd d ƒ| g}n | g}xC| D];}x2|D]*} |jd||df|| fƒqaWqTWxj|dD]^}|ddhkrºPnx?| D]7}x.|D]&} |jd||f|| fƒqÎWqÁWqžWx3|D](} |jd|ddd | fƒqWn|jd||dfd dfƒ|jd||ddfd dfƒxdt|ƒD]V\}}|jd|fd dfƒ|dkr|jd|dd dfƒqqW|S(scReturn a list of supported tags for each version specified in `versions`. :param versions: a list of string versions, of the form ["33", "32"], or None. The first version will be assumed to support our ABI. :param platform: specify the exact platform you want valid tags for, or None. If None, use the local system platform. :param impl: specify the exact implementation you want valid tags for, or None. If None, use the local interpreter impl. :param abi: specify the exact abi you want valid tags for, or None. If None, use the local interpreter abi. iÿÿÿÿRiNs.abiR6iitnonetmacosxs {}_{}_%i_%stlinuxt manylinux1s%s%st31t30spy%stany(R RtrangeR`RRRRR<tsettimpt get_suffixesRtaddR8textendtsortedtlistRIt _osx_arch_pattmatchRZRtreversedtintRbRUR9t enumerate(tversionstnoarchRR1R;t supportedR"R#R$tabistabi3sRltsuffixRWRstnamet actual_archttplRaR2tatversionti((s9/tmp/pip-build-0nEYGB/setuptools/setuptools/pep425tags.pyt get_supportedÜsh   -  ( #"    ,  , )$( %( t__doc__t __future__Rtdistutils.utilRGRtreRRRt collectionsRRRtcompileRrRRR!RR%RVR)R<R>RIRURbR RNRƒtimplementation_tag(((s9/tmp/pip-build-0nEYGB/setuptools/setuptools/pep425tags.pyts0          "    = _