Your IP : 18.119.124.204


Current Path : /opt/alt/python34/lib/python3.4/site-packages/pip/commands/__pycache__/
Upload File :
Current File : //opt/alt/python34/lib/python3.4/site-packages/pip/commands/__pycache__/install.cpython-34.pyc

�
�Re�5�@s�ddlZddlZddlZddlZddlmZmZmZddlm	Z	ddl
mZmZm
Z
mZddlmZddlmZddlmZmZmZddlmZdd	lmZGd
d�de�ZdS)�N)�InstallRequirement�RequirementSet�parse_requirements)�logger)�
src_prefix�virtualenv_no_global�distutils_scheme�build_prefix)�Command)�
PackageFinder)�InstallationError�CommandError�PreviousBuildDirError)�
cmdoptions)�BuildDirectorycsXeZdZdZdZdZdZdZ�fdd�Zdd	�Z	d
d�Z
�S)�InstallCommandaI
    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.
    �installz�
      %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> ...zInstall packages.Fc
shtt|�j||�|j}|jdddddddgdd	d
d�|jtjj��|jtjj��|jdd
ddddddd
d�|jddddddddddd
d�|jtj	j��|jdddddddddt
d
d�|jdddddd d
d!�|jd"dd#dd d
d$�|jd%d&dd'dd d
d(�|jtjj��|jd)dd*dd d
d+�|jd,dd-dd d
d.�|jtjj��|jtj
j��|jd/dd0dd d
d1�|jd2dd3dd d
d4�|jd5dd6ddddd
d7�|jd8dd9dd:ddd
d;�|jd<dd dd=dd>d
d?�|jd@ddAdd=d
dB�|jtjj��|jtjj��|jdCdd ddDd
dE�|jtjj��tjtj|j�}|jjdF|�|jjdF|�dS)GNz-ez
--editable�dest�	editables�action�append�default�metavarzpath/url�helpzkInstall a project in editable mode (i.e. setuptools "develop mode") from a local project path or a VCS url.z-tz--target�
target_dir�dirzInstall packages into <dir>.z-dz
--downloadz--download-dirz--download-directory�download_dirz`Download packages into <dir> instead of installing them, regardless of what's already installed.z--srcz--sourcez--source-dirz--source-directory�src_dirz�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".z-Uz	--upgrade�upgrade�
store_truez�Upgrade all packages to the newest available version. This process is recursive regardless of whether a dependency is already satisfied.z--force-reinstall�force_reinstallzKWhen upgrading, reinstall all packages even if they are already up-to-date.z-Iz--ignore-installed�ignore_installedz5Ignore the installed packages (reinstalling instead).z--no-install�
no_installzNDEPRECATED. Download and unpack all packages, but don't actually install them.z
--no-download�no_downloadzDEPRECATED. Don't download any packages, just install the ones already downloaded (completes an install run with --no-install).z--user�
use_user_sitezInstall using the user scheme.z--egg�as_eggz�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.)z--root�	root_pathz=Install everything relative to this alternate root directory.z--strip-file-prefix�strip_file_prefix�prefixz5Strip given prefix from script paths in wheel RECORD.z	--compile�compileTzCompile py files to pycz--no-compile�store_falsezDo not compile py files to pycz--preFzYInclude pre-release and development versions. By default, pip only finds stable versions.r)�superr�__init__�cmd_opts�
add_optionr�requirements�make�	build_dir�download_cacher�no_deps�install_options�global_options�	use_wheel�no_use_wheel�no_clean�make_option_group�index_group�parser�insert_option_group)�self�args�kwr-�
index_opts)�	__class__��//tmp/pip-ztkk0jow-build/pip/commands/install.pyr,(s�					zInstallCommand.__init__cCsRtd|jd|d|jd|jd|jd|jd|jd|jd	|�	S)
z�
        Create a package finder appropriate to this install command.
        This method is meant to be overridden by subclasses, not
        called directly.
        �
find_links�
index_urlsr6�allow_external�allow_unverified�allow_all_external�allow_all_prereleases�process_dependency_links�session)rrDr6rFrGrH�prerJ)r=�optionsrErKrBrBrC�_build_package_finder�s						z$InstallCommand._build_package_finderc"Cs|js$|js$|js$|jr7tjdd�n|jrUd|_d|_n|jdkr�|jsv|jr�t|_n|jr�t	j
j|j�|_nt	j
j|j�|_|j
p�g}|jr�t�r�td��n|jd�nd}|jr�d|_tj�}t	j
j|j�|_t	j
j|j�rtt	j
j|j�rttd��n|jd|�n|jp�g}|jg|j}|jr�tjdd	j|��g}n|jr�tjdd
�n|jrtjdd�||j7}n|j |�}|j!|||�}|jpN|j}	t"|jd|	��}
t#d
|
d|jd|jd|j$d|j%d|j&d|jd|j'd|j(d|jd|d|d|j)�
}x'|D]}|j*t+j,|d��q�Wx0|j-D]%}|j*t+j.|d|j/��qWxG|j0D]<}
x3t1|
d|d|d|�D]}|j*|�qkWqFW|j2s�i|j3d6}|j4r�dt5|dd j|j4��}n
d!|}tj6|�dSzEy |js|j7|d"|j8d#|j8�n
|j9�|jr�|j8r�|j:||d$|j;d%|j<�d jd&d'�|j=D��}|r
tjd(|�q
nu|j8s�d jd)d'�|j>D��}|r
tjd*|�q
n0|j8r
|j?|j@�tjd+|j@�nWntAk
r+d|_�YnXWd|jrc|jsM|jrc|jBd#|j8�nXWdQX|jrt	j
j|j�s�t	jC|j�ntDd,d-|�d.}xHt	jE|�D]7}tFjGt	j
j||�t	j
j|j|��q�WtFjH|�n|S)/Nz1.7z~DEPRECATION: --no-install, --no-download, --build, and --no-clean are deprecated.  See https://github.com/pypa/pip/issues/906.TzZCan not perform a '--user' install. User site-packages are not visible in this virtualenv.z--userz=Target path exists but is not a directory, will not continue.z--home=zIgnoring indexes: %s�,z�--use-mirrors has been deprecated and will be removed in the future. Explicit uses of --index-url and/or --extra-index-url is suggested.z�--mirrors has been deprecated and will be removed in  the future. Explicit uses of --index-url and/or --extra-index-url is suggested.�deleter1rrr2rr%r!�ignore_dependenciesr r$rrK�	pycompile�default_vcs�finderrM�namez^You must give at least one requirement to %(name)s (maybe you meant "pip %(name)s %(links)s"?)�links� zLYou must give at least one requirement to %(name)s (see "pip help %(name)s")�force_root_egg_info�bundle�rootr'cSsg|]}|j�qSrB)rU)�.0�reqrBrBrC�
<listcomp>4s	z&InstallCommand.run.<locals>.<listcomp>zSuccessfully installed %scSsg|]}|j�qSrB)rU)r[r\rBrBrCr]9s	zSuccessfully downloaded %szCreated bundle in %s��home�purelib)Ir"r#r1r8r�
deprecatedrr!r	�os�path�abspathrr4r$rrrr�tempfile�mkdtemp�exists�isdirr
r5�	index_url�extra_index_urls�no_index�notify�join�use_mirrors�mirrors�_build_sessionrNrrr2rr%rQr r)�add_requirementr�	from_liner�
from_editablerSr/r�has_requirementsrUrD�dict�warn�
prepare_filesrY�locate_filesrr&r'�successfully_installed�successfully_downloaded�
create_bundle�bundle_filenamer�
cleanup_files�makedirsr�listdir�shutil�move�rmtree)r=rMr>r4�temp_target_dirr5rErKrT�build_deleter1�requirement_setrU�filenamer\�opts�msg�	installed�
downloaded�lib_dir�itemrBrBrC�run�s�											+				
											
%		"
	"
	
		
		zInstallCommand.run)�__name__�
__module__�__qualname__�__doc__rU�usage�summaryrYr,rNr�rBrB)rArCrs�r)rb�sysrer��pip.reqrrr�pip.logr�
pip.locationsrrrr	�pip.basecommandr
�	pip.indexr�pip.exceptionsrr
r�pipr�pip.utilrrrBrBrBrC�<module>s"

?>