ó
j·Ã^c           @   s   d  d l  Z  d  d l m Z m Z d  d l m Z d  d l m Z e rw d  d l m	 Z	 m
 Z
 m Z d  d l m Z n  d e f d     YZ d S(	   iĸĸĸĸN(   t   get_supportedt   version_info_to_nodot(   t   normalize_version_info(   t   MYPY_CHECK_RUNNING(   t   Listt   Optionalt   Tuple(   t   Tagt   TargetPythonc           B   s5   e  Z d  Z d d d d d  Z d   Z d   Z RS(   sx   
    Encapsulates the properties of a Python interpreter one is targeting
    for a package install, download, etc.
    c         C   s   | |  _  | d k r% t j d  } n t |  } d j t t | d    } | |  _ | |  _	 | |  _
 | |  _ | |  _ d |  _ d S(   s'  
        :param platform: A string or None. If None, searches for packages
            that are supported by the current system. Otherwise, will find
            packages that can be built on the platform passed in. These
            packages will only be downloaded for distribution: they will
            not be built locally.
        :param py_version_info: An optional tuple of ints representing the
            Python version information to use (e.g. `sys.version_info[:3]`).
            This can have length 1, 2, or 3 when provided.
        :param abi: A string or None. This is passed to compatibility_tags.py's
            get_supported() function as is.
        :param implementation: A string or None. This is passed to
            compatibility_tags.py's get_supported() function as is.
        i   t   .i   N(   t   _given_py_version_infot   Nonet   syst   version_infoR   t   joint   mapt   strt   abit   implementationt   platformt
   py_versiont   py_version_infot   _valid_tags(   t   selfR   R   R   R   R   (    (    s3   site-packages/pip/_internal/models/target_python.pyt   __init__   s    						c         C   s~   d	 } |  j d	 k	 r4 d j d   |  j D  } n  d |  j f d | f d |  j f d |  j f g } d j d   | D  S(
   sD   
        Format the given, non-None attributes for display.
        R	   c         s   s   |  ] } t  |  Vq d  S(   N(   R   (   t   .0t   part(    (    s3   site-packages/pip/_internal/models/target_python.pys	   <genexpr>H   s    R   R   R   R   t    c         s   s3   |  ]) \ } } | d k	 r d  j | |  Vq d S(   s   {}={!r}N(   R   t   format(   R   t   keyt   value(    (    s3   site-packages/pip/_internal/models/target_python.pys	   <genexpr>R   s    	N(   R   R
   R   R   R   R   (   R   t   display_versiont
   key_values(    (    s3   site-packages/pip/_internal/models/target_python.pyt   format_given@   s    	c      	   C   sv   |  j  d k ro |  j } | d k r- d } n t |  } t d | d |  j d |  j d |  j  } | |  _  n  |  j  S(   sĪ   
        Return the supported PEP 425 tags to check wheel candidates against.

        The tags are returned in order of preference (most preferred first).
        t   versionR   R   t   implN(   R   R   R
   R   R    R   R   R   (   R   R   R"   t   tags(    (    s3   site-packages/pip/_internal/models/target_python.pyt   get_tagsV   s    				N(   t   __name__t
   __module__t   __doc__R   R   R!   R%   (    (    (    s3   site-packages/pip/_internal/models/target_python.pyR      s   $	(   R   t&   pip._internal.utils.compatibility_tagsR    R   t   pip._internal.utils.miscR   t   pip._internal.utils.typingR   t   typingR   R   R   t   pip._vendor.packaging.tagsR   t   objectR   (    (    (    s3   site-packages/pip/_internal/models/target_python.pyt   <module>   s   