ó
'šMc           @   sµ   d  d l  Z  d  d l Z d  d l 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 d  d l m Z d	 e f d
 „  ƒ  YZ e ƒ  d S(   iÿÿÿÿN(   t   InstallRequirementt   RequirementSet(   t   parse_requirements(   t   logger(   t   build_prefixt
   src_prefix(   t   Command(   t   PackageFinder(   t   InstallationErrort   InstallCommandc           B   s;   e  Z d  Z d Z d Z e Z d „  Z d „  Z d „  Z	 RS(   t   installs    %prog [OPTIONS] PACKAGE_NAMES...s   Install packagesc         C   si  t  t |  ƒ j ƒ  |  j j d d d d d d d g  d d	 d
 d ƒ|  j j d d d d d d d g  d d d
 d ƒ|  j j d d d d d d d g  d d d
 d ƒ|  j j d d d d d d d d d d
 d ƒ|  j j d d d d d d d d g  d
 d ƒ|  j j d d d  d d! d t d
 d" ƒ|  j j d# d$ d d% d d! d t d
 d& ƒ|  j j d' d d( d d d d d g  d
 d) ƒ|  j j d* d+ d, d- d d. d d/ d d  d
 d0 t ƒ|  j j d1 d2 d3 d4 d d5 d d/ d d  d
 d6 ƒ|  j j d7 d d8 d d/ d d  d
 d9 ƒ|  j j d: d; d< d= d d> d d/ d d  d
 d? t ƒ|  j j d@ dA d dB d d! d
 dC ƒ|  j j dD dE d dF d d! d
 dG ƒ|  j j dH dI d dJ d d! d t d
 dK ƒ|  j j dL d dM d d! d
 dN ƒ|  j j dO d dP d d! d
 dQ ƒ|  j j dR d dS d d d
 dT ƒ|  j j dU d dV d d d
 dW ƒ|  j j dX d dY d d! d
 dZ ƒd  S([   Ns   -es
   --editablet   destt	   editablest   actiont   appendt   defaultt   metavars   VCS+REPOS_URL[@REV]#egg=PACKAGEt   helpsM  Install a package directly from a checkout. Source will be checked out into src/PACKAGE (lower-case) and installed in-place (using setup.py develop). You can run this on an existing directory/checkout (like pip install -e src/mycheckout). This option may be provided multiple times. Possible values for VCS are: svn, git, hg and bzr.s   -rs   --requirementt   requirementst   FILENAMEsh   Install all the packages listed in the given requirements file.  This option can be used multiple times.s   -fs   --find-linkst
   find_linkst   URLs   URL to look for packages ats   -is   --index-urls
   --pypi-urlt	   index_urls   http://pypi.python.org/simple/s3   Base URL of Python Package Index (default %default)s   --extra-index-urlt   extra_index_urlss?   Extra URLs of package indexes to use in addition to --index-urls
   --no-indext   no_indext
   store_trues@   Ignore package index (only looking at --find-links URLs instead)s   -Ms   --use-mirrorst   use_mirrorssB   Use the PyPI mirrors as a fallback in case the main index is down.s	   --mirrorst   mirrorss8   Specific mirror URLs to query when --use-mirrors is useds   -bs   --builds   --build-dirs   --build-directoryt	   build_dirt   DIRs:   Unpack packages into DIR (default %s) and build from theres   -ds
   --downloads   --download-dirs   --download-directoryt   download_dirs5   Download packages into DIR instead of installing thems   --download-cachet   download_caches    Cache downloaded packages in DIRs   --srcs   --sources   --source-dirs   --source-directoryt   src_dirs3   Check out --editable packages into DIR (default %s)s   -Us	   --upgradet   upgrades4   Upgrade all packages to the newest available versions   -Is   --ignore-installedt   ignore_installeds4   Ignore the installed packages (reinstalling instead)s	   --no-depss   --no-dependenciest   ignore_dependenciess   Ignore package dependenciess   --no-installt
   no_installsA   Download and unpack all packages, but don't actually install thems   --no-downloadt   no_downloadsr   Don't download any packages, just install the ones already downloaded (completes an install run with --no-install)s   --install-optiont   install_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_optionssR   Extra global options to be supplied to the setup.pycall before the install commands   --usert   use_user_sites   Install to user-site(	   t   superR	   t   __init__t   parsert
   add_optiont   Falset   NoneR   R   (   t   self(    (    s8   /usr/lib/python2.7/dist-packages/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.
        R   t
   index_urlsR   R   (   R   R   R   R   (   R/   t   optionsR0   (    (    s8   /usr/lib/python2.7/dist-packages/pip/commands/install.pyt   _build_package_finder™   s    	c         C   sè  | j  s t | _  n  | j s* t | _ n  | j rH t | _ t | _ n  t j	 j
 | j  ƒ | _  t j	 j
 | j ƒ | _ | j p„ g  } | j r  | 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 ƒ } x' | D] } | j t j | d  ƒ ƒ qOWx0 | j D]% } | j t j | d | j  ƒƒ q|WxA | j! D]6 }	 x- t" |	 d | d | ƒD] }
 | j |
 ƒ qÎWq¯W| j# sB| j$ r#t% d |  j& d j | j$ ƒ f ƒ ‚ n  t% d t' d |  j& ƒ ƒ ‚ n  | j rit( j) d k  rit% d ƒ ‚ n  d d  l* } | j r©| j+ r©t, | d t- ƒ r©t% d ƒ ‚ n  | j. sÔ| j/ | d |  j0 d |  j0 ƒn
 | j1 ƒ  | j rG|  j0 rG| j2 | | ƒ d j g  | j3 D] }
 |
 j& ^ qƒ } | rÅt j d | ƒ qÅn~ |  j0 s•d j g  | j4 D] }
 |
 j& ^ q`ƒ } | rÅt j d | ƒ qÅn0 |  j0 rÅ| j5 |  j6 ƒ t j d |  j6 ƒ n  | j sä| j7 d |  j0 ƒ n  | S(   Ns   --users   Ignoring indexes: %st   ,R   R    R   R   R!   R"   R#   t   default_vcst   finderR1   sP   You must give at least one requirement to %s (maybe you meant "pip install %s"?)t    sL   You must give at least one requirement to %(name)s (see "pip help %(name)s")t   namei   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   bundles   Successfully installed %ss   Successfully downloaded %ss   Created bundle in %s(   i   i   (8   R   R   R    R   R   t   TrueR$   R"   t   ost   patht   abspathR&   R(   R   R'   R   R   R   R   t   notifyt   joinR2   R   R   R!   R#   t   add_requirementR    t	   from_lineR.   R   t   from_editableR4   R   R   t   has_requirementsR   R   R7   t   dictt   syst   version_infot
   setuptoolst   has_editablest   getattrR-   R%   t   prepare_filesR:   t   locate_filesR
   t   successfully_installedt   successfully_downloadedt   create_bundlet   bundle_filenamet   cleanup_files(   R/   R1   t   argsR&   R'   R0   R5   t   requirement_setR7   t   filenamet   reqRH   t	   installedt
   downloaded(    (    s8   /usr/lib/python2.7/dist-packages/pip/commands/install.pyt   run¤   sŠ    															"				"
					(
   t   __name__t
   __module__R7   t   usaget   summaryR-   R:   R*   R2   RX   (    (    (    s8   /usr/lib/python2.7/dist-packages/pip/commands/install.pyR	      s   	ˆ	(   R<   RF   t   pip.reqR    R   R   t   pip.logR   t   pip.locationsR   R   t   pip.basecommandR   t	   pip.indexR   t   pip.exceptionsR   R	   (    (    (    s8   /usr/lib/python2.7/dist-packages/pip/commands/install.pyt   <module>   s   ì