ó
^†êWc           @@  sc  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 Z y d  d l Z Wn e	 k
 r d Z n Xd  d l m Z d  d l m Z d  d l m Z m Z d  d l 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 d  d l m Z d  d l  m! Z! m" Z" e j# e$ ƒ Z% d e f d „  ƒ  YZ& d S(   i    (   t   absolute_importN(   t   RequirementSet(   t   RequirementCommand(   t   virtualenv_no_globalt   distutils_scheme(   t   InstallationErrort   CommandErrort   PreviousBuildDirError(   t
   cmdoptions(   t
   ensure_dir(   t   BuildDirectory(   t   RemovedInPip10Warning(   t   check_path_owner(   t
   WheelCachet   WheelBuildert   InstallCommandc           B@  s2   e  Z d  Z d Z d Z d Z d „  Z d „  Z RS(   sI  
    Install packages from:

    - PyPI (and other indexes) using requirement specifiers.
    - VCS project urls.
    - Local project directories.
    - Local or remote source archives.

    pip also supports installing from "requirements files", which provide
    an easy way to specify a whole environment to be installed.
    t   installs%  
      %prog [options] <requirement specifier> [package-index-options] ...
      %prog [options] -r <requirements file> [package-index-options] ...
      %prog [options] [-e] <vcs project url> ...
      %prog [options] [-e] <local project path> ...
      %prog [options] <archive url/path> ...s   Install packages.c         O@  s  t  t |  ƒ j | | Ž  |  j } | j t j ƒ  ƒ | j t j ƒ  ƒ | j t j ƒ  ƒ | j t j	 ƒ  ƒ | j d d d d d d d d  d d	 ƒ| j d
 d d d d d d d d d  d d ƒ| j t j ƒ  ƒ | j d d d d d d d d ƒ| j d d d d d d d ƒ| j d d d d d d d d ƒ| j t j ƒ  ƒ | j t j ƒ  ƒ | j t j ƒ  ƒ | j d d d d d d d ƒ| j d  d d! d d d d" ƒ| j d# d d$ d d d d  d d% ƒ| j d& d d' d d d d  d d( ƒ| j d) d d d d* d t d d+ ƒ| j d, d d- d d* d d. ƒ| j t j ƒ  ƒ | j t j ƒ  ƒ | j t j ƒ  ƒ | j t j ƒ  ƒ | j t j ƒ  ƒ | j t j ƒ  ƒ | j t j ƒ  ƒ t j t j |  j ƒ } |  j j d/ | ƒ |  j j d/ | ƒ d  S(0   Ns   -ts   --targett   destt
   target_dirt   metavart   dirt   defaultt   helps¥   Install packages into <dir>. By default this will not replace existing files/folders in <dir>. Use --upgrade to replace existing packages in <dir> with new versions.s   -ds
   --downloads   --download-dirs   --download-directoryt   download_dirs`   Download packages into <dir> instead of installing them, regardless of what's already installed.s   -Us	   --upgradet   upgradet   actiont
   store_trues’   Upgrade all specified packages to the newest available version. This process is recursive regardless of whether a dependency is already satisfied.s   --force-reinstallt   force_reinstallsK   When upgrading, reinstall all packages even if they are already up-to-date.s   -Is   --ignore-installedt   ignore_installeds5   Ignore the installed packages (reinstalling instead).s   --usert   use_user_sites¸   Install to the Python user install directory for your platform. Typically ~/.local/, or %APPDATA%\Python on Windows. (See the Python documentation for site.USER_BASE for full details.)s   --eggt   as_eggsâ   Install packages as eggs, not 'flat', like pip normally does. This option is not about installing *from* eggs. (WARNING: Because this option overrides pip's normal install logic, requirements files may not behave as expected.)s   --roott	   root_paths=   Install everything relative to this alternate root directory.s   --prefixt   prefix_pathsI   Installation prefix where lib, bin and other top-level folders are placeds	   --compilet   compiles   Compile py files to pycs   --no-compilet   store_falses   Do not compile py files to pyci    (   t   superR   t   __init__t   cmd_optst
   add_optionR   t   constraintst   editablet   requirementst	   build_dirt   Nonet   srct   no_depst   install_optionst   global_optionst   Truet	   use_wheelt   no_use_wheelt	   no_binaryt   only_binaryt   pret   no_cleant   require_hashest   make_option_groupt   index_groupt   parsert   insert_option_group(   t   selft   argst   kwR%   t
   index_opts(    (    se   /private/var/folders/3n/6h2rwf155rn1m71wwyxn79n80000gn/T/pip-build-IcAT_k/pip/pip/commands/install.pyR$   6   s¤    				c      '   C@  s  t  j | ƒ t  j | ƒ | j r6 t j d t ƒ n  | j rR t j d t ƒ n  | j rn t j d t ƒ n  | j	 r“ t j d t ƒ t
 | _ n  | j r· t j j | j ƒ | _ n  t j j | j ƒ | _ | j pÛ g  } | j r4| j rÿ t d ƒ ‚ n  t ƒ  rt d ƒ ‚ n  | j d ƒ | j d ƒ n  d  } | j r¾t
 | _ t j ƒ  } t j j | j ƒ | _ t j j | j ƒ rªt j j | j ƒ rªt d	 ƒ ‚ n  | j d
 | ƒ n  | j pÊg  } |  j | ƒ 
} |  j  | | ƒ } | j! p | j } t" | j# | j$ ƒ }	 | j# rQt% | j# ƒ rQt& j' d | j# ƒ d  | _# n  t( | j d | ƒz}
 t) d |
 d | j d | j	 d | j* d | j+ d | j d | j, d | j- d | j d | d | d | j. d | j/ d |	 d | j0 ƒ } |  j1 | | | | | |  j2 |	 ƒ | j3 sd  Sz¦y‚| j	 s<t4 s<| j# rL| j5 | ƒ n+ t6 | | d g  d g  ƒ} | j7 d t
 ƒ | j	 s_| j8 | | d | j9 d  | j ƒt: | j; d! t< j= d" ƒ ƒ} g  } xk | D]c } | j2 } y3 t> | d# ƒ r| j? r| d$ | j? 7} qn  Wn t@ k
 r"n X| j | ƒ qÍWd% jA | ƒ } | r t& jB d& | ƒ q nA d% jA g  | jC D] } | j2 ^ qoƒ } | r t& jB d' | ƒ n  Wn tD k
 rÀt
 | _! ‚  n XWd  | j! sÛ| jE ƒ  n  XWd  QXWd  QX| j r tF | j ƒ tG d( d) | ƒd* } xÙ t jH | ƒ D]È } t j jA | j | ƒ } t j j | ƒ rÍ| j* sst& j' d+ | ƒ q$n  t j jI | ƒ r›t& j' d, | ƒ q$n  t j j | ƒ r½tJ jK | ƒ qÍt jL | ƒ n  tJ jM t j jA | | ƒ | ƒ q$WtJ jK | ƒ n  | S(-   Ns   --allow-external has been deprecated and will be removed in the future. Due to changes in the repository protocol, it no longer has any effect.s“   --allow-all-external has been deprecated and will be removed in the future. Due to changes in the repository protocol, it no longer has any effect.s‘   --allow-unverified has been deprecated and will be removed in the future. Due to changes in the repository protocol, it no longer has any effect.s‰   pip install --download has been deprecated and will be removed in the future. Pip now has a download command that should be used instead.sV   Can not combine '--user' and '--prefix' as they imply different installation locationssZ   Can not perform a '--user' install. User site-packages are not visible in this virtualenv.s   --users	   --prefix=s=   Target path exists but is not a directory, will not continue.s   --home=sÝ   The directory '%s' or its parent directory is not owned by the current user and caching wheels has been disabled. check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.t   deleteR*   t   src_dirR   R   R   R   t   ignore_dependenciesR   R   R   t   sessiont	   pycompilet   isolatedt   wheel_cacheR7   t   build_optionsR/   t   autobuildingt   roott   prefixt   keyt   namet   installed_versiont   -t    s   Successfully installed %ss   Successfully downloaded %st    t   homet   purelibsK   Target directory %s already exists. Specify --upgrade to force replacement.s„   Target directory %s already exists and is a link. Pip will not automatically replace links, please remove if replacement is desired.(N   R   t   resolve_wheel_no_use_binaryt   check_install_build_globalt   allow_externalt   warningst   warnR   t   allow_all_externalt   allow_unverifiedR   R0   R   R*   t   ost   patht   abspathRA   R.   R   R    R   R   R   t   appendR+   R   t   tempfilet   mkdtempt   existst   isdirR/   t   _build_sessiont   _build_package_finderR6   R   t	   cache_dirt   format_controlR   t   loggert   warningR
   R   R   R   RB   R   R!   t   isolated_modeR7   t   populate_requirement_setRL   t   has_requirementst   wheelt   prepare_filesR   t   buildR   R   t   sortedt   successfully_installedt   operatort
   attrgettert   hasattrRM   t	   Exceptiont   joint   infot   successfully_downloadedR   t   cleanup_filesR	   R   t   listdirt   islinkt   shutilt   rmtreet   removet   move(   R<   t   optionsR=   R.   t   temp_target_dirR/   RC   t   findert   build_deleteRF   R*   t   requirement_sett   wbt   reqst   itemst   reqt   itemt	   installedt
   downloadedt   lib_dirt   target_item_dir(    (    se   /private/var/folders/3n/6h2rwf155rn1m71wwyxn79n80000gn/T/pip-build-IcAT_k/pip/pip/commands/install.pyt   run²   s   	
	
	
							
											 
			
							(   t   __name__t
   __module__t   __doc__RL   t   usaget   summaryR$   RŒ   (    (    (    se   /private/var/folders/3n/6h2rwf155rn1m71wwyxn79n80000gn/T/pip-build-IcAT_k/pip/pip/commands/install.pyR      s   	|('   t
   __future__R    t   loggingRp   RZ   R^   Rz   RV   Rk   t   ImportErrorR+   t   pip.reqR   t   pip.basecommandR   t   pip.locationsR   R   t   pip.exceptionsR   R   R   t   pipR   t	   pip.utilsR	   t   pip.utils.buildR
   t   pip.utils.deprecationR   t   pip.utils.filesystemR   t	   pip.wheelR   R   t	   getLoggerR   Rf   R   (    (    (    se   /private/var/folders/3n/6h2rwf155rn1m71wwyxn79n80000gn/T/pip-build-IcAT_k/pip/pip/commands/install.pyt   <module>   s,   
