ó `8(Zc@@sqdZddlmZddlZddlZddlZddlZddlZyddlZWn e k r„ddl jZnXddl Z ddl mZddlZejeƒZejdƒZd„Zd„Zd„Zd „Zd „Zeed „Zd „Zd „Zd„Zd„Z d„Z!de#dddd„Z$e$ƒZ%e$deƒZ&eƒZ'dS(s2Generate and work with PEP 425 Compatibility Tags.i(tabsolute_importN(t OrderedDicts(.+)_(\d+)_(\d+)_(.+)cC@sEytj|ƒSWn-tk r@}tjdj|ƒtƒdSXdS(Ns{0}(t sysconfigtget_config_vartIOErrortwarningstwarntformattRuntimeWarningtNone(tvarte((s+/tmp/pip-build-0nEYGB/pip/pip/pep425tags.pyRs cC@sUttdƒrd}n9tjjdƒr3d}ntjdkrKd}nd}|S(s'Return abbreviated implementation name.tpypy_version_infotpptjavatjytclitiptcp(thasattrtsystplatformt startswith(tpyimpl((s+/tmp/pip-build-0nEYGB/pip/pip/pep425tags.pyt get_abbr_impl!s   cC@sDtdƒ}| s"tƒdkr@djtttƒƒƒ}n|S(sReturn implementation version.tpy_version_nodotR t(RRtjointmaptstrtget_impl_version_info(timpl_ver((s+/tmp/pip-build-0nEYGB/pip/pip/pep425tags.pyt get_impl_ver.s cC@sKtƒdkr/tjdtjjtjjfStjdtjdfSdS(sQReturn sys.version_info-like tuple for use in decrementing the minor version.R iiN(RRt version_infoR tmajortminor(((s+/tmp/pip-build-0nEYGB/pip/pip/pep425tags.pyR6s cC@sdjtƒtƒƒS(s; Returns the Tag for this specific implementation. s{0}{1}(RRR (((s+/tmp/pip-build-0nEYGB/pip/pip/pep425tags.pyt get_impl_tagAscC@sBt|ƒ}|dkr8|r1tjd|ƒn|ƒS||kS(sgUse a fallback method for determining SOABI flags if the needed config var is unset or unavailable.s>Config variable '%s' is unset, Python ABI tag may be incorrectN(RR tloggertdebug(R tfallbacktexpectedRtval((s+/tmp/pip-build-0nEYGB/pip/pip/pep425tags.pytget_flagHs    c @sgtdƒ}tƒ‰| rˆdkrttdƒrd}d}d}tdd„dˆdkƒrpd }ntd ‡fd †dˆdkƒrd }ntd d„dddˆdkoÊtjdkƒrètjdkrèd}ndˆtƒ|||f}n\|r6|jdƒr6d|jdƒd}n-|r]|j ddƒj ddƒ}nd}|S(sXReturn the ABI tag based on SOABI (if available) or emulate SOABI (CPython 2, PyPy).tSOABIRR t maxunicodeRtPy_DEBUGcS@s ttdƒS(Ntgettotalrefcount(RR(((s+/tmp/pip-build-0nEYGB/pip/pip/pep425tags.pyt^sRtdt WITH_PYMALLOCc@s ˆdkS(NR(((timpl(s+/tmp/pip-build-0nEYGB/pip/pip/pep425tags.pyR/bstmtPy_UNICODE_SIZEcS@s tjdkS(Niÿÿ(RR,(((s+/tmp/pip-build-0nEYGB/pip/pip/pep425tags.pyR/fsR(iitus %s%s%s%s%sscpython-t-it.t_(scpspp(ii(iiN( RRRRR*R!R RtsplittreplaceR (tsoabiR0R3R5tabi((R2s+/tmp/pip-build-0nEYGB/pip/pip/pep425tags.pyt get_abi_tagTs8  "      !cC@s tjdkS(Niÿÿÿ(Rtmaxsize(((s+/tmp/pip-build-0nEYGB/pip/pip/pep425tags.pyt_is_running_32bitvscC@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'tdarwinR7tx86_64ti386tppc64tppcsmacosx_{0}_{1}_{2}iiR8R6t linux_x86_64t linux_i686( RRtmac_verR9R?Rt distutilstutilt get_platformR:(treleaseR8tmachinet split_vertresult((s+/tmp/pip-build-0nEYGB/pip/pip/pep425tags.pyRJzs  ' cC@s`tƒdkrtSyddl}t|jƒSWnttfk rInXtjj j ddƒS(NRERFiii(s linux_x86_64s linux_i686( RJtFalset _manylinuxtbooltmanylinux1_compatiblet ImportErrortAttributeErrortpiptutilstglibcthave_compatible_glibc(RP((s+/tmp/pip-build-0nEYGB/pip/pip/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( NRDi iRCRBiRA(i i(i i(i i(i i(tTrueRO(R"R#tarchtgarch(t_supports_archtgroups(s+/tmp/pip-build-0nEYGB/pip/pip/pep425tags.pyR]«s      tfatRBRDtintelRAtfat64RCtfat32t universal(si386sppc(sx86_64si386(sx86_64sppc64(sx86_64si386sppc(Rtappend(R"R#RLtarchesR\((R]R^s+/tmp/pip-build-0nEYGB/pip/pip/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 ƒ|s0|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ƒqaWqTWxd|dD]X}|dkr´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ƒq‰q‰W|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.abiR7iitnonetmacosxs {0}_{1}_%i_%stlinuxt manylinux1s%s%st31t30spy%stany(s31s30(R RtrangeRdRRRRR=tsettimpt get_suffixesRtaddR9textendtsortedtlistRJt _osx_arch_pattmatchR^RtreversedtintRfRYR:t enumerate(tversionstnoarchRR2R<t supportedR!R"R#tabistabi3sRptsuffixR[Rwtnamet actual_archttplReR3tatversionti((s+/tmp/pip-build-0nEYGB/pip/pip/pep425tags.pyt get_supportedâsh   -  ( #"    ,   , )$( %R|((t__doc__t __future__RtreRRRtloggingRRStdistutils.sysconfigtdistutils.utilRHt pip.compatRtpip.utils.glibcRUt getLoggert__name__R%tcompileRvRRR RR$RZR*R=R?RJRYRfR ROR‡tsupported_tagstsupported_tags_noarchtimplementation_tag(((s+/tmp/pip-build-0nEYGB/pip/pip/pep425tags.pyts>            "    = ^