ó
€
\c           @   sî   d  d l  Z  d  d l Z d  d l Z d  d l Z d  d l m Z m Z m Z d  d l 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 m Z d  d l m Z d  d	 l m Z m Z d
 e f d „  ƒ  YZ d S(   iÿÿÿÿN(   t   InstallRequirementt   RequirementSett   parse_requirements(   t   logger(   t   build_prefixt
   src_prefixt   virtualenv_no_global(   t   Command(   t   PackageFinder(   t   InstallationErrort   CommandError(   t   home_lib(   t   make_option_groupt   index_groupt   InstallCommandc           B   sA   e  Z d  Z d Z d Z d Z e Z d „  Z d „  Z	 d „  Z
 RS(   sª  
    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.

    See http://www.pip-installer.org for details on VCS url formats and
    requirements files.
    t   installsõ   
      %prog [options] <requirement specifier> ...
      %prog [options] -r <requirements file> ...
      %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 d d d d d d d g  d d	 d
 d ƒ| j d d d d d d d g  d d d
 d ƒ| j d d d d d d d d d t d
 d ƒ| 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 d" d d# d d d d  d
 d$ ƒ| j d% d& d' d( d d) d d d t d
 d* ƒ| j d+ d, d d- d d. d
 d/ ƒ| j d0 d d1 d d. d
 d2 ƒ| j d3 d4 d d5 d d. d
 d6 ƒ| j d7 d8 d d9 d d. d t d
 d: ƒ| j d; d d< d d. d
 d= ƒ| j d> d d? d d. d
 d@ ƒ| j dA d dB d d d dC d
 dD ƒ| j dE d dF d d d dC d
 dG ƒ| j dH d dI d d. d
 dJ ƒ| j dK d dL d d. d
 dM ƒ| j dN d dO d d d d  d
 dP ƒt	 t
 |  j ƒ } |  j j dQ | ƒ |  j j dQ | ƒ d  S(R   Ns   -es
   --editablet   destt	   editablest   actiont   appendt   defaultt   metavars   path/urlt   helpsk   Install a project in editable mode (i.e. setuptools "develop mode") from a local project path or a VCS url.s   -rs   --requirementt   requirementst   filesQ   Install from the given requirements file. This option can be used multiple times.s   -bs   --builds   --build-dirs   --build-directoryt	   build_dirt   dirs¬   Directory to unpack packages into and build in. The default in a virtualenv is "<venv path>/build". The default for global installs is "<OS temp dir>/pip-build-<username>".s   -ts   --targett
   target_dirs   Install packages into <dir>.s   -ds
   --downloads   --download-dirs   --download-directoryt   download_dirsb   Download packages into <dir> instead of installing them, irregardless of what's already installed.s   --download-cachet   download_caches#   Cache downloaded packages in <dir>.s   --srcs   --sources   --source-dirs   --source-directoryt   src_dirs˜   Directory to check out editable projects into. The default in a virtualenv is "<venv path>/src". The default for global installs is "<current dir>/src".s   -Us	   --upgradet   upgradet
   store_truesŠ   Upgrade all packages to the newest available version. This process is recursive irregardless 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	   --no-depss   --no-dependenciest   ignore_dependenciess#   Don't install package dependencies.s   --no-installt
   no_installsB   Download and unpack all packages, but don't actually install them.s   --no-downloadt   no_downloadss   Don't download any packages, just install the ones already downloaded (completes an install run with --no-install).s   --install-optiont   install_optionst   optionss"  Extra arguments to be supplied to the setup.py install command (use like --install-option="--install-scripts=/usr/local/bin"). Use multiple --install-option options to pass multiple options to setup.py install. If you are using an option with a directory path, be sure to use absolute path.s   --global-optiont   global_optionssT   Extra global options to be supplied to the setup.py call before the install command.s   --usert   use_user_sites   Install using the user scheme.s   --eggt   as_eggs;   Install as self contained egg file, like easy_install does.s   --roott	   root_paths=   Install everything relative to this alternate root directory.i    (   t   superR   t   __init__t   cmd_optst
   add_optionR   t   NoneR   t   FalseR   R   t   parsert   insert_option_group(   t   selft   argst   kwR.   t
   index_opts(    (    s[   /data/av2000/b2b/venv/lib/python2.7/site-packages/pip-1.3-py2.7.egg/pip/commands/install.pyR-   *   sØ    							c      	   C   s(   t  d | j d | d | j d | j ƒ S(   s¨   
        Create a package finder appropriate to this install command.
        This method is meant to be overridden by subclasses, not
        called directly.
        t
   find_linkst
   index_urlst   use_mirrorst   mirrors(   R   R8   R:   R;   (   R4   R'   R9   (    (    s[   /data/av2000/b2b/venv/lib/python2.7/site-packages/pip-1.3-py2.7.egg/pip/commands/install.pyt   _build_package_finder¹   s    	c         C   s)  | j  r t | _ t | _ n  t j j | j ƒ | _ t j j | j ƒ | _ | j	 pZ g  } | j
 rŽ t ƒ  r~ t d ƒ ‚ n  | j d ƒ n  | 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 g | j } | j r`t j d d j | ƒ ƒ g  } n  |  j | | ƒ } t d | j d | j d	 | j  d
 | j d | j d | j d | j d | j  d | j! d | j
 ƒ 
} x' | D] }	 | j" t# j$ |	 d  ƒ ƒ qÜWx0 | j& D]% }	 | j" t# j' |	 d | j( ƒƒ q	WxA | j) D]6 }
 x- t* |
 d | d | ƒD] } | j" | ƒ q[Wq<W| j+ sØi |  j, d 6} | j- r½d t. | d d j | j- ƒ ƒ} n
 d | } t j/ | ƒ d  S| j
 rÿt0 j1 d% k  rÿt d ƒ ‚ n  d d  l2 } | j
 r?| j3 r?t4 | d t5 ƒ r?t d ƒ ‚ n  | j6 sj| j7 | d |  j8 d  |  j8 ƒn
 | j9 ƒ  | j ræ|  j8 ræ| j: | | d! | j; ƒd j g  | j< D] } | j, ^ q±ƒ } | rdt j d" | ƒ qdn~ |  j8 s4d j g  | j= D] } | j, ^ qÿƒ } | rdt j d# | ƒ qdn0 |  j8 rd| j> |  j? ƒ t j d$ |  j? ƒ n  | j sw| j  r| j@ d  |  j8 ƒ n  | j r%t j j | j ƒ s¾t jA | j ƒ n  tB | ƒ } xH t jC | ƒ D]7 } tD jE t j j | | ƒ t j j | j | ƒ ƒ qÚWtD jF | ƒ n  | S(&   NsZ   Can not perform a '--user' install. User site-packages are not visible in this virtualenv.s   --users=   Target path exists but is not a directory, will not continue.s   --home=s   Ignoring indexes: %st   ,R   R   R   R   R   R*   R"   R#   R!   R)   t   default_vcst   finderR'   t   names^   You must give at least one requirement to %(name)s (maybe you meant "pip %(name)s %(links)s"?)t   linkst    sL   You must give at least one requirement to %(name)s (see "pip help %(name)s")i   i   s8   --user is only supported in Python version 2.6 and neweriÿÿÿÿt   _distributes?   --user --editable not supported with setuptools, use distributet   force_root_egg_infot   bundlet   roots   Successfully installed %ss   Successfully downloaded %ss   Created bundle in %s(   i   i   (G   R   t   TrueR$   R"   t   ost   patht   abspathR   R   R&   R)   R   R	   R   R   t   tempfilet   mkdtempt   existst   isdirR
   R(   t	   index_urlt   extra_index_urlst   no_indexR   t   notifyt   joinR<   R   R   R   R*   R#   R!   t   add_requirementR    t	   from_lineR0   R   t   from_editableR>   R   R   t   has_requirementsR@   R8   t   dictt   warnt   syst   version_infot
   setuptoolst   has_editablest   getattrR1   R%   t   prepare_filesRE   t   locate_filesR   R+   t   successfully_installedt   successfully_downloadedt   create_bundlet   bundle_filenamet   cleanup_filest   makedirsR   t   listdirt   shutilt   movet   rmtree(   R4   R'   R5   R&   t   temp_target_dirR(   R9   R?   t   requirement_setR@   t   filenamet   reqt   optst   msgR\   t	   installedt
   downloadedt   lib_dirt   item(    (    s[   /data/av2000/b2b/venv/lib/python2.7/site-packages/pip-1.3-py2.7.egg/pip/commands/install.pyt   runÄ   s²    						+													"				"
					(   t   __name__t
   __module__t   __doc__R@   t   usaget   summaryR1   RE   R-   R<   Ru   (    (    (    s[   /data/av2000/b2b/venv/lib/python2.7/site-packages/pip-1.3-py2.7.egg/pip/commands/install.pyR      s   		(   RH   RZ   RK   Rh   t   pip.reqR    R   R   t   pip.logR   t   pip.locationsR   R   R   t   pip.basecommandR   t	   pip.indexR   t   pip.exceptionsR	   R
   t   pip.backwardcompatR   t   pip.cmdoptionsR   R   R   (    (    (    s[   /data/av2000/b2b/venv/lib/python2.7/site-packages/pip-1.3-py2.7.egg/pip/commands/install.pyt   <module>   s   