
{Udc           @   sP  d  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 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 m Z m Z m Z d d l m  Z  d d l! m" Z" d d l# m$ Z$ d d l% m& Z& e& rd d l' m( Z( d d l) m* Z* m+ Z+ m, Z, m- Z- d d l. m/ Z/ d d l0 m1 Z1 d d l2 m3 Z3 d d l4 m5 Z5 d d l6 m7 Z7 d d l# m8 Z8 m9 Z9 n  e j: e;  Z< d e f d     YZ= d e
 e= f d     YZ> e$ j? e$ j@ e$ jA g ZB d   ZC d  e> f d!     YZD d S("   s  Contains the Command base classes that depend on PipSession.

The classes in this module are in a separate module so the commands not
needing download / PackageFinder capability don't unnecessarily import the
PackageFinder machinery and all its vendored dependencies, etc.
iN(   t   partial(   t   PY2(   t
   cmdoptions(   t   Command(   t   CommandContextMixIn(   t   CommandErrort   PreviousBuildDirError(   t   LinkCollector(   t   PackageFinder(   t   SelectionPreferences(   t
   PipSession(   t   RequirementPreparer(   t   install_req_from_editablet   install_req_from_linet#   install_req_from_parsed_requirementt   install_req_from_req_string(   t   parse_requirements(   t   pip_self_version_check(   t   tempdir_kinds(   t   MYPY_CHECK_RUNNING(   t   Values(   t   Anyt   Listt   Optionalt   Tuple(   t
   WheelCache(   t   TargetPython(   t   InstallRequirement(   t   RequirementTracker(   t   BaseResolver(   t   TempDirectoryt   TempDirectoryTypeRegistryt   SessionCommandMixinc           B   s>   e  Z d  Z d   Z e d    Z d   Z d d d  Z RS(   sE   
    A class mixin for command classes needing _build_session().
    c         C   s    t  t |   j   d  |  _ d  S(   N(   t   superR    t   __init__t   Nonet   _session(   t   self(    (    sk   /var/www/html/phendo-backend/phendo_python/env/lib/python2.7/site-packages/pip/_internal/cli/req_command.pyR"   6   s    c         C   su   g  } t  | d t  sC t  | d d  } | rC | j |  qC n  t  | d d  } | rk | j |  n  | pt d S(   s7   Return a list of index urls from user-provided options.t   no_indext	   index_urlt   extra_index_urlsN(   t   getattrt   FalseR#   t   appendt   extend(   t   clst   optionst
   index_urlst   urlt   urls(    (    sk   /var/www/html/phendo-backend/phendo_python/env/lib/python2.7/site-packages/pip/_internal/cli/req_command.pyt   _get_index_urls;   s    c         C   sI   |  j  d k rB |  j |  j |   |  _  |  j  d k	 sB t  n  |  j  S(   s   Get a default-managed session.N(   R$   R#   t   enter_contextt   _build_sessiont   AssertionError(   R%   R.   (    (    sk   /var/www/html/phendo-backend/phendo_python/env/lib/python2.7/site-packages/pip/_internal/cli/req_command.pyt   get_default_sessionJ   s    c      
   C   s%  | j  s% t j j | j   s% t  t d | j  rL t j j | j  d  n d  d | d  k	 rd | n | j d | j	 d |  j
 |   } | j r | j | _ n  | j r | j | _ n  | j s | r | d  k	 r | n | j | _ n  | j ri | j d 6| j d 6| _ n  | j | j _ | S(   Nt   cachet   httpt   retriest   trusted_hostsR/   t   https(   t	   cache_dirt   ost   patht   isabsR5   R
   t   joinR#   R9   R:   R2   t   certt   verifyt   client_certt   timeoutt   proxyt   proxiest   no_inputt   autht	   prompting(   R%   R.   R9   RD   t   session(    (    sk   /var/www/html/phendo-backend/phendo_python/env/lib/python2.7/site-packages/pip/_internal/cli/req_command.pyR4   U   s$    %'			!	
N(	   t   __name__t
   __module__t   __doc__R"   t   classmethodR2   R6   R#   R4   (    (    (    sk   /var/www/html/phendo-backend/phendo_python/env/lib/python2.7/site-packages/pip/_internal/cli/req_command.pyR    1   s
   		t   IndexGroupCommandc           B   s   e  Z d  Z d   Z RS(   s   
    Abstract base class for commands with the index_group options.

    This also corresponds to the commands that permit the pip version check.
    c         C   sp   t  | d  s t  | j s' | j r+ d S|  j | d d d t d | j  } |  t | |  Wd QXd S(   s   
        Do the pip version check if not disabled.

        This overrides the default behavior of not doing the check.
        R&   NR9   i    RD   i   (   t   hasattrR5   t   disable_pip_version_checkR&   R4   t   minRD   R   (   R%   R.   RJ   (    (    sk   /var/www/html/phendo-backend/phendo_python/env/lib/python2.7/site-packages/pip/_internal/cli/req_command.pyt   handle_pip_version_check   s    (   RK   RL   RM   RS   (    (    (    sk   /var/www/html/phendo-backend/phendo_python/env/lib/python2.7/site-packages/pip/_internal/cli/req_command.pyRO   }   s   c            s   d        f d   } | S(   sN   Decorator for common logic related to managing temporary
    directories.
    c         S   s%   x t  D] } |  j | t  q Wd  S(   N(   t   KEEPABLE_TEMPDIR_TYPESt
   set_deleteR*   (   t   registryt   t(    (    sk   /var/www/html/phendo-backend/phendo_python/env/lib/python2.7/site-packages/pip/_internal/cli/req_command.pyt   configure_tempdir_registry   s    c            sj   |  j  d  k	 s t  | j r.   |  j   n  y  |  | |  SWn! t k
 re   |  j     n Xd  S(   N(   t   tempdir_registryR#   R5   t   no_cleanR   (   R%   R.   t   args(   RX   t   func(    sk   /var/www/html/phendo-backend/phendo_python/env/lib/python2.7/site-packages/pip/_internal/cli/req_command.pyt   wrapper   s    	(    (   R\   R]   (    (   RX   R\   sk   /var/www/html/phendo-backend/phendo_python/env/lib/python2.7/site-packages/pip/_internal/cli/req_command.pyt   with_cleanup   s    	t   RequirementCommandc        
   B   s   e  Z d    Z e d    Z e d d   Z e d e e	 e e d d d d   Z
 d   Z e d    Z d d d  Z RS(	   c         O   s3   t  t |   j | |   |  j j t j    d  S(   N(   R!   R_   R"   t   cmd_optst
   add_optionR   RZ   (   R%   R[   t   kw(    (    sk   /var/www/html/phendo-backend/phendo_python/env/lib/python2.7/site-packages/pip/_internal/cli/req_command.pyR"      s    c         C   s7   t  r  d |  j k r d Sd Sn  d |  j k r3 d Sd S(   sE   Determines which resolver should be used, based on the given options.s   2020-resolvert   legacys   legacy-resolver(   R   t   features_enabledt   deprecated_features_enabled(   R.   (    (    sk   /var/www/html/phendo-backend/phendo_python/env/lib/python2.7/site-packages/pip/_internal/cli/req_command.pyt   determine_resolver_variant   s    c         C   s   | j  } | d k	 s t  |  j |  }	 |	 d k r^ d | j k }
 |
 r t j d  q n% t }
 d | j k r t j d  n  t d | d | j	 d | d | j
 d	 | d
 | d | j d | d | j d | d |
  S(   sQ   
        Create a RequirementPreparer instance for the given parameters.
        s   2020-resolvers	   fast-depss   pip is using lazily downloaded wheels using HTTP range requests to obtain dependency information. This experimental feature is enabled through --use-feature=fast-deps and it is not ready for production.s;   fast-deps has no effect when used with the legacy resolver.t	   build_dirt   src_dirt   download_dirt   build_isolationt   req_trackerRJ   t   progress_bart   findert   require_hashest   use_user_sitet
   lazy_wheelN(   R>   R#   R5   Rf   Rd   t   loggert   warningR*   R   Rh   Rj   Rl   Rn   (   R-   t   temp_build_dirR.   Rk   RJ   Rm   Ro   Ri   t   temp_build_dir_patht   resolver_variantRp   (    (    sk   /var/www/html/phendo-backend/phendo_python/env/lib/python2.7/site-packages/pip/_internal/cli/req_command.pyt   make_requirement_preparer   s0    	
				s   to-satisfy-onlyc         C   s  t  t d | j d |
 } |  j |  } | d k r d d l } | j j j j j	 d | d | d | d	 | d
 | d | j
 d | d | d | d |	 d |  Sd d l } | j j j j j	 d | d | d | d	 | d
 | d | j
 d | d | d | d |	 d |  S(   sF   
        Create a Resolver instance for the given parameters.
        t   isolatedt
   use_pep517s   2020-resolveriNt   preparerRm   t   wheel_cachet   make_install_reqRo   t   ignore_dependenciest   ignore_installedt   ignore_requires_pythont   force_reinstallt   upgrade_strategyt   py_version_info(   R    R   t   isolated_modeRf   t,   pip._internal.resolution.resolvelib.resolvert	   _internalt
   resolutiont
   resolvelibt   resolvert   ResolverR|   t(   pip._internal.resolution.legacy.resolverRc   (   R-   Ry   Rm   R.   Rz   Ro   R}   R~   R   R   Rx   R   R{   Ru   t   pip(    (    sk   /var/www/html/phendo-backend/phendo_python/env/lib/python2.7/site-packages/pip/_internal/cli/req_command.pyt   make_resolver
  s@    				c         C   s  g  } xh | j  D]] } xT t | d t d | d | d | D]. } t | d | j d t } | j |  q; Wq WxB | D]: }	 t |	 d d | j d | j	 d t } | j |  qx WxB | j
 D]7 }	 t |	 d t d | j d | j	 } | j |  q Wxk | j D]` } xW t | d | d | d | D]7 } t | d | j d | j	 d t } | j |  q*WqWt d   | D  rt | _ n  | p| j
 p| j si |  j d	 6}
 | j rt d
 j t |
 d d j | j      qt d j |
     n  | S(   sS   
        Parse command-line arguments into the corresponding requirements.
        t
   constraintRm   R.   RJ   Rw   t   user_suppliedRx   c         s   s   |  ] } | j  Vq d  S(   N(   t   has_hash_options(   t   .0t   req(    (    sk   /var/www/html/phendo-backend/phendo_python/env/lib/python2.7/site-packages/pip/_internal/cli/req_command.pys	   <genexpr>|  s    t   namesX   You must give at least one requirement to {name} (maybe you meant "pip {name} {links}"?)t   linkst    sH   You must give at least one requirement to {name} (see "pip help {name}")N(   t   constraintsR   t   TrueR   R   R*   R+   R   R#   Rx   t	   editablesR   t   requirementst   anyRn   R   t
   find_linksR   t   formatt   dictR@   (   R%   R[   R.   Rm   RJ   R   t   filenamet
   parsed_reqt
   req_to_addR   t   opts(    (    sk   /var/www/html/phendo-backend/phendo_python/env/lib/python2.7/site-packages/pip/_internal/cli/req_command.pyt   get_requirementsE  s\    									'c         C   s/   |  j  } | j   } | r+ t j |  n  d S(   sE   
        Trace basic information about the provided objects.
        N(   t   search_scopet   get_formatted_locationsRq   t   info(   Rm   R   t	   locations(    (    sk   /var/www/html/phendo-backend/phendo_python/env/lib/python2.7/site-packages/pip/_internal/cli/req_command.pyt   trace_basic_info  s    	c         C   sa   t  j | d | } t d t d | j d | j d | j d |  } t j d | d | d	 |  S(
   s   
        Create a package finder appropriate to this requirement command.

        :param ignore_requires_python: Whether to ignore incompatible
            "Requires-Python" values in links. Defaults to False.
        R.   t   allow_yankedt   format_controlt   allow_all_prereleasest   prefer_binaryR~   t   link_collectort   selection_prefst   target_python(   R   t   createR	   R   R   t   preR   R   (   R%   R.   RJ   R   R~   R   R   (    (    sk   /var/www/html/phendo-backend/phendo_python/env/lib/python2.7/site-packages/pip/_internal/cli/req_command.pyt   _build_package_finder  s    					N(   RK   RL   R"   t   staticmethodRf   RN   R#   Rv   R*   R   R   R   R   R   (    (    (    sk   /var/www/html/phendo-backend/phendo_python/env/lib/python2.7/site-packages/pip/_internal/cli/req_command.pyR_      s"   		).	H(E   RM   t   loggingR=   t	   functoolsR    t   pip._vendor.sixR   t   pip._internal.cliR   t   pip._internal.cli.base_commandR   t!   pip._internal.cli.command_contextR   t   pip._internal.exceptionsR   R   t   pip._internal.index.collectorR   t"   pip._internal.index.package_finderR   t$   pip._internal.models.selection_prefsR	   t   pip._internal.network.sessionR
   t    pip._internal.operations.prepareR   t   pip._internal.req.constructorsR   R   R   R   t   pip._internal.req.req_fileR   t!   pip._internal.self_outdated_checkR   t   pip._internal.utils.temp_dirR   t   pip._internal.utils.typingR   t   optparseR   t   typingR   R   R   R   t   pip._internal.cacheR   t"   pip._internal.models.target_pythonR   t   pip._internal.req.req_installR   t   pip._internal.req.req_trackerR   t   pip._internal.resolution.baseR   R   R   t	   getLoggerRK   Rq   R    RO   t	   BUILD_ENVt   EPHEM_WHEEL_CACHEt	   REQ_BUILDRT   R^   R_   (    (    (    sk   /var/www/html/phendo-backend/phendo_python/env/lib/python2.7/site-packages/pip/_internal/cli/req_command.pyt   <module>   sF   ""L 	