σ
Π²Ebc           @@  s»  d  d l  m Z d  d l Z d  d l Z d  d l Z d  d l Z d  d l Z d  d l m Z d  d l	 m
 Z
 d  d l m Z d  d l m Z d  d l m Z d  d l m Z d  d	 l m Z d  d
 l m Z d  d l m Z d  d l m Z e rAd  d l m Z d  d l m Z d  d l m  Z  m! Z! m" Z" d  d l# m$ Z$ n  e j% e&  Z' d   Z( d   Z) d   Z* d   Z+ d   Z, d   Z- d   Z. d   Z/ d   Z0 d e f d     YZ1 d S(   i    (   t   absolute_importN(   t   pkg_resources(   t   where(   t   __file__(   t
   cmdoptions(   t   Command(   t   make_target_python(   t   SUCCESS(   t
   indent_log(   t   get_pip_version(   t   MYPY_CHECK_RUNNING(   t   Values(   t
   ModuleType(   t   Dictt   Listt   Optional(   t   Configurationc         C@  s   t  j d |  |  d  S(   Ns   %s: %s(   t   loggert   info(   t   namet   value(    (    s9   /tmp/pip-build-UPPWic/pip/pip/_internal/commands/debug.pyt
   show_value   s    c          C@  sX   t  j d  t t d  r1 t j }  |  j } n d } t    t d |  Wd  QXd  S(   Ns   sys.implementation:t   implementationt    R   (   R   R   t   hasattrt   sysR   R   R   R   (   R   t   implementation_name(    (    s9   /tmp/pip-build-UPPWic/pip/pip/_internal/commands/debug.pyt   show_sys_implementation$   s    	
c       	   C@  s   t  j j t  j j t  d d  }  t |   H } g  | j   D]. } d | k r@ | j   j d d  d ^ q@ } Wd  QXt	 d   | D  S(   Nt   _vendors
   vendor.txts   ==t    i   i    c         s@  s!   |  ] } | j  d  d  Vq d S(   s   ==i   N(   t   split(   t   .0t   line(    (    s9   /tmp/pip-build-UPPWic/pip/pip/_internal/commands/debug.pys	   <genexpr>@   s    (
   t   ost   patht   joint   dirnamet   pip_locationt   opent	   readlinest   stripR   t   dict(   t   vendor_txt_patht   fR    t   lines(    (    s9   /tmp/pip-build-UPPWic/pip/pip/_internal/commands/debug.pyt   create_vendor_txt_map1   s    		Dc         C@  sV   |  j    }  |  d k r! d }  n  t d j |   t   t   d d t t j |   S(   Nt
   setuptoolsR   s   pip._vendor.{}t   leveli    (   t   lowert
   __import__t   formatt   globalst   localst   getattrt   pipR   (   t   module_name(    (    s9   /tmp/pip-build-UPPWic/pip/pip/_internal/commands/debug.pyt   get_module_from_module_nameC   s    		c         C@  sy   t  |   } t | d d   } | su t j t j j | j  g  } | j	 t j
 j |    } t | d d   } n  | S(   Nt   __version__t   version(   R8   R5   t   NoneR   t
   WorkingSetR!   R"   R$   R   t   findt   Requirementt   parse(   R7   t   moduleR:   t   pkg_sett   package(    (    s9   /tmp/pip-build-UPPWic/pip/pip/_internal/commands/debug.pyt   get_vendor_version_from_moduleT   s    c         C@  s|   xu |  j    D]g \ } } d } t |  } | s@ d } | } n | | k r^ d j |  } n  t j d | | |  q Wd S(   s{   Log the actual version and print extra info if there is
    a conflict or if the actual version could not be imported.
    R   sM    (Unable to locate actual module version, using vendor.txt specified version)s5    (CONFLICT: vendor.txt suggests version should be {})s   %s==%s%sN(   t   itemsRC   R2   R   R   (   t   vendor_txt_versionsR7   t   expected_versiont   extra_messaget   actual_version(    (    s9   /tmp/pip-build-UPPWic/pip/pip/_internal/commands/debug.pyt   show_actual_vendor_versionsh   s    	c          C@  s4   t  j d  t   }  t    t |   Wd  QXd  S(   Ns   vendored library versions:(   R   R   R-   R   RI   (   RE   (    (    s9   /tmp/pip-build-UPPWic/pip/pip/_internal/commands/debug.pyt   show_vendor_versionsz   s    	
c   	      C@  s  d } t  |   } | j   } | j   } d } | rH d j |  } n  d j t |  |  } t j |  |  j d k  r‘ t |  | k r‘ t } | |  } n t	 } t
   Q x! | D] } t j t |   qΈ W| rύ d j d |  } t j |  n  Wd  QXd  S(   Ni
   R   s    (target: {})s   Compatible tags: {}{}i   s?   ...
[First {tag_limit} tags shown. Pass --verbose to show all.]t	   tag_limit(   R   t   get_tagst   format_givenR2   t   lenR   R   t   verboset   Truet   FalseR   t   str(	   t   optionsRK   t   target_pythont   tagst   formatted_targett   suffixt   msgt   tags_limitedt   tag(    (    s9   /tmp/pip-build-UPPWic/pip/pip/_internal/commands/debug.pyt	   show_tags   s(    !
		c         C@  s±   t    } x4 |  j   D]& \ } } | j | j d  d  q W| sJ d Sd d d g } g  | D] } | | k r` | ^ q` } | s d Sd | k r€ | j d  n  d j |  S(	   Nt   .i    s   Not specifiedt   installt   wheelt   downloadt   globals   , (   t   setRD   t   addR   t   removeR#   (   t   configt   levelst   keyt   _t   levels_that_override_globalR/   t   global_overriding_level(    (    s9   /tmp/pip-build-UPPWic/pip/pip/_internal/commands/debug.pyt   ca_bundle_info₯   s    	%t   DebugCommandc           B@  s,   e  Z d  Z d Z e Z d   Z d   Z RS(   s$   
    Display debug information.
    s   
      %prog <options>c         C@  s:   t  j |  j  |  j j d |  j  |  j j j   d  S(   Ni    (   R   t   add_target_python_optionst   cmd_optst   parsert   insert_option_groupRd   t   load(   t   self(    (    s9   /tmp/pip-build-UPPWic/pip/pip/_internal/commands/debug.pyt   add_optionsΓ   s    c         C@  s  t  j d  t d t    t d t j  t d t j  t d t j    t d t j    t d t	 j
    t d t j  t   t d	 t |  j j   t d
 t j j d
   t d t j j d   t d t    t d t j j  t   t |  t S(   NsΈ   This command is only meant for debugging. Do not use this with automation for parsing and getting these details, since the output and options of this command may change without notice.s   pip versions   sys.versions   sys.executables   sys.getdefaultencodings   sys.getfilesystemencodings   locale.getpreferredencodings   sys.platforms   'cert' config valuet   REQUESTS_CA_BUNDLEt   CURL_CA_BUNDLEs   pip._vendor.certifi.where()s   pip._vendor.DEBUNDLED(   R   t   warningR   R	   R   R:   t
   executablet   getdefaultencodingt   getfilesystemencodingt   localet   getpreferredencodingt   platformR   Rj   Rn   Rd   R!   t   environt   getR   R6   R   t	   DEBUNDLEDRJ   R[   R   (   Rq   RS   t   args(    (    s9   /tmp/pip-build-UPPWic/pip/pip/_internal/commands/debug.pyt   runΙ   s&    
(   t   __name__t
   __module__t   __doc__t   usageRP   t   ignore_require_venvRr   R   (    (    (    s9   /tmp/pip-build-UPPWic/pip/pip/_internal/commands/debug.pyRk   Ί   s
   	(2   t
   __future__R    Ry   t   loggingR!   R   t   pip._vendorR6   R   t   pip._vendor.certifiR   R   R%   t   pip._internal.cliR   t   pip._internal.cli.base_commandR   t   pip._internal.cli.cmdoptionsR   t   pip._internal.cli.status_codesR   t   pip._internal.utils.loggingR   t   pip._internal.utils.miscR	   t   pip._internal.utils.typingR
   t   optparseR   t   typesR   t   typingR   R   R   t   pip._internal.configurationR   t	   getLoggerR   R   R   R   R-   R8   RC   RI   RJ   R[   Rj   Rk   (    (    (    s9   /tmp/pip-build-UPPWic/pip/pip/_internal/commands/debug.pyt   <module>   s>   									"	