� �fc@@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/usr/lib/python2.7/site-packages/setuptools/pep425tags.pyRs cC@sUttd�rd}n9tjjd�r3d}ntjdkrKd}nd}|S(s'Return abbreviated implementation name.tpypy_version_infotpptjavatjytclitiptcp(thasattrtsystplatformt startswith(tpyimpl((s9/usr/lib/python2.7/site-packages/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/usr/lib/python2.7/site-packages/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/usr/lib/python2.7/site-packages/setuptools/pep425tags.pyR0s cC@sdjt�t��S(s; Returns the Tag for this specific implementation. s{}{}(RRR!(((s9/usr/lib/python2.7/site-packages/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/usr/lib/python2.7/site-packages/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/usr/lib/python2.7/site-packages/setuptools/pep425tags.pytXRRtdt WITH_PYMALLOCc@s �dkS(NR(((timpl(s9/usr/lib/python2.7/site-packages/setuptools/pep425tags.pyR.\RtmtPy_UNICODE_SIZEcS@s tjdkS(Ni��(RR+(((s9/usr/lib/python2.7/site-packages/setuptools/pep425tags.pyR.`RR'iitus %s%s%s%s%sscpython-t-it.t_(ii(iiN( RRRRR)R"R!RtsplittreplaceR (tsoabiR/R2R4tabi((R1s9/usr/lib/python2.7/site-packages/setuptools/pep425tags.pyt get_abi_tagNs8  (      !cC@s tjdkS(Ni���(Rtmaxsize(((s9/usr/lib/python2.7/site-packages/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/usr/lib/python2.7/site-packages/setuptools/pep425tags.pyRIts  ' cC@s`t�ddhkrtSyddl}t|j�SWnttfk rOnXtjdd�S(NRDREiii( RItFalset _manylinuxtbooltmanylinux1_compatiblet ImportErrortAttributeErrorRthave_compatible_glibc(RO((s9/usr/lib/python2.7/site-packages/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/usr/lib/python2.7/site-packages/setuptools/pep425tags.pyRY�s      tfatRARCtintelR@tfat64RBtfat32t universal(RARC(R@RA(R@RB(R@RARC(Rtappend(R#R$RKtarchesRX((RYRZs9/usr/lib/python2.7/site-packages/setuptools/pep425tags.pytget_darwin_arches�s$    " cC@s�g}|dkrug}t�}|d }xGt|ddd�D],}|jdjtt||f���qBWn|p�t�}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�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.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/usr/lib/python2.7/site-packages/setuptools/pep425tags.pyt get_supported�sh   -  ( #"    ,  , )$( %( t__doc__t __future__Rtdistutils.utilRGRtreRRRt collectionsRRRtcompileRrRRR!RR%RVR)R<R>RIRURbR RNR�timplementation_tag(((s9/usr/lib/python2.7/site-packages/setuptools/pep425tags.pyts0          "    = _