Spade

Mini Shell

Directory:~$ /proc/self/root/usr/lib/python3.6/site-packages/pip/commands/__pycache__/
Upload File

[Home] [System Details] [Kill Me]
Current File:~$ //proc/self/root/usr/lib/python3.6/site-packages/pip/commands/__pycache__/install.cpython-36.pyc

3

���^qG�@s(ddlmZddlZddlZddlZddlZddlZddlZddlZddlm	Z	yddl
Z
Wnek
rtdZ
YnXddlm
Z
ddlmZddlmZmZddlmZmZmZddlmZdd	lmZmZdd
lmZddlmZddl
m!Z!dd
l"m#Z#m$Z$ej%e&�Z'Gdd�de�Z(dd�Z)dS)�)�absolute_importN)�path)�RequirementSet)�RequirementCommand)�virtualenv_no_global�distutils_scheme)�InstallationError�CommandError�PreviousBuildDirError)�
cmdoptions)�
ensure_dir�get_installed_version)�BuildDirectory)�RemovedInPip10Warning)�check_path_owner)�
WheelCache�WheelBuildercs4eZdZdZdZdZdZ�fdd�Zdd�Z�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.
    �installa%
      %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> ...zInstall packages.c
s0tt|�j||�|j}|jtj��|jtj��|jtj��|jtj	��|jddddddd�|jddd	d
ddddd�|jtj
��|jd
ddddd�|jdddddgdd�|jddddd�|jdddddd�|jtj��|jtj��|jtj
��|jtj��|jd
d!dd"d�|jd#d$dd%d�|jd&d'ddd(d�|jd)d*d+dd,d�|jd-d.ddd/d�|jd0dd1d2d3d4�|jd5d6d1d7d8�|jtj��|jtj��|jtj��|jtj��|jtj��|jtj��|jtj��tjtj|j�}|jjd9|�|jjd9|�dS):Nz-tz--target�
target_dir�dirz�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.)�dest�metavar�default�helpz-dz
--downloadz--download-dirz--download-directory�download_dirz`Download
packages into <dir> instead of installing them, regardless of
what's already installed.z-Uz	--upgrade�upgrade�
store_truez�Upgrade all specified packages to the newest available
version. The handling of dependencies depends on the upgrade-strategy
used.)r�actionrz--upgrade-strategy�upgrade_strategyZeagerzonly-if-neededa3Determines
how dependency upgrading should be handled. "eager" -
dependencies are upgraded regardless of whether the currently installed
version satisfies the requirements of the upgraded package(s).
"only-if-needed" -  are upgraded only when they do not satisfy
the requirements of the upgraded
package(s).)rr�choicesrz--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--user�
use_user_sitez�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.)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--prefix�prefix_pathzIInstallation prefix where lib, bin and
other top-level folders are placedz	--compile�compileTzCompile py files
to pyc)rrrrz--no-compileZstore_falsezDo not compile py files to
pyc)rrrr)�superr�__init__�cmd_optsZ
add_optionrZconstraintsZeditableZrequirements�	build_dir�src�ignore_requires_pythonZno_deps�install_options�global_optionsZ	use_wheelZno_use_wheelZ	no_binaryZonly_binaryZpre�no_clean�require_hashesZmake_option_groupZindex_group�parserZinsert_option_group)�self�args�kwr,Z
index_opts)�	__class__��/usr/lib/python3.6/install.pyr+8s�zInstallCommand.__init__c&Cstj|�tj|�dd�}tj�dkrJ|�rJtjdtjt	j
d��|jr\tj
dt�|jrntj
dt�|jr�tj
dt�|jr�tj
dt�|jr�tj
d	t�d
|_|jr�tjj|j�|_tjj|j�|_|jp�g}|j�r|jr�td��t�r�td��|jd
�|jd�d}|j�rtd
|_tj
�}tjj|j�|_tjj!|j��rftjj"|j��rftd��|jd|�|j#�p~g}|j$|���T}|j%||�}|j&�p�|j}	t'|j(|j)�}
|j(�r�t*|j(��r�tjd|j(�d|_(t+|j|	d����}t,||j|j|j-|j.|j|j|j/|j0|j1|j|||j2|j3|
|j4d�}|j5||||||j6|
�|j7�s\dS�z`�y:|j�s~t8�s~|j(�r�|j9|�nt:||ggd�}
|
j;d
d�|j�sr|j<|||j=|j|j>d�t?|j||j=|j|j3d�}t@|jAtBjCd�d�}g}xX|D]P}|j6}y"tD|j6|�}|�r*|d|7}WntEk
�rBYnX|j|��qWdjF|�}|�r�tjGd|�n(djFdd�|jHD��}|�r�tjGd|�WntIk
�r�d
|_&�YnXWd|j&�s�|jJ�XWdQRXWdQRX|j�rtK|j�g}tLd
|d!�d"}tLd
|d!�d#}tjj!|��r4|j|�tjj!|��rV||k�rV|j|�x�|D]�}x�tjM|�D]�}tjjF|j|�}tjj!|��r�|j-�s�tjd$|��qltjjN|��r�tjd%|��qltjj"|��r�tOjP|�n
tjQ|�tOjRtjjF||�|��qlW�q\WtOjP|�|S)&NcSs
ttd�pttd�otjtjkS)NZreal_prefix�base_prefix)�hasattr�sysr;r'r9r9r9r:�is_venv�s
z#InstallCommand.run.<locals>.is_venvrzpWARNING: Running pip
install with root privileges is generally not a good idea. Try `%s install
--user` instead.z�--egg has been deprecated and will be removed in the
future. This flag is mutually exclusive with large parts of pip, and
actually using it invalidates pip's ability to manage the installation
process.z�--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.z�--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.z�--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.z�pip install --download has been deprecated and will be removed
in the future. Pip now has a download command that should be used
instead.TzVCan not combine '--user' and '--prefix' as
they imply different installation locationszZCan not perform a
'--user' install. User site-packages are not visible in this
virtualenv.z--userz	--prefix=z=Target path exists but is not a directory,
will not continue.z--home=z�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.)�delete)r-�src_dirrrrr$r"�ignore_dependenciesr/r!r#r�sessionZ	pycompile�isolated�wheel_cacher3)Z
build_optionsr1)Zautobuilding)�rootr'r&)�user�homerEr'rC�name)�key�-�
zSuccessfully installed %scSsg|]
}|j�qSr9)rH)�.0�reqr9r9r:�
<listcomp>�sz&InstallCommand.run.<locals>.<listcomp>zSuccessfully
downloaded %s�)rG�purelib�platlibzKTarget directory %s already
exists. Specify --upgrade to force replacement.z�Target directory %s
already exists and is a link. Pip will not automatically replace links,
please remove if replacement is
desired.)SrZresolve_wheel_no_use_binaryZcheck_install_build_global�os�getuid�loggerZwarningr�basenamer=�argvr$�warnings�warnrZallow_externalZallow_all_externalZallow_unverifiedrr"r-�abspathr@r0r#r(r	rr�appendr�tempfileZmkdtemp�exists�isdirr1Z_build_sessionZ_build_package_finderr2r�	cache_dirZformat_controlrrrrrrAr/r!r)Z
isolated_moder3Zpopulate_requirement_setrHZhas_requirements�wheelZ
prepare_filesrZbuildrr%r&�get_lib_location_guesses�sortedZsuccessfully_installed�operator�
attrgetterr
�	Exception�join�infoZsuccessfully_downloadedr
Z
cleanup_filesrr�listdir�islink�shutilZrmtree�removeZmove)r5Zoptionsr6r>r0Ztemp_target_dirr1rB�finderZbuild_deleterDr-Zrequirement_set�wbZpossible_lib_locationsZreqs�itemsrM�itemZinstalled_versionZ	installedZ
downloadedZlib_dir_listZpurelib_dirZplatlib_dirZlib_dirZtarget_item_dirr9r9r:�run�sP

















zInstallCommand.run)
�__name__�
__module__�__qualname__�__doc__rHZusageZsummaryr+ro�
__classcell__r9r9)r8r:r!srcOstd|�|�}|d|dgS)NrOrPrQ)rO)r)r6�kwargs�schemer9r9r:r`�sr`)*Z
__future__rZloggingrbrRr[rirWr=rr_�ImportErrorZpip.reqrZpip.basecommandrZ
pip.locationsrrZpip.exceptionsrr	r
ZpiprZ	pip.utilsrr
Zpip.utils.buildrZpip.utils.deprecationrZpip.utils.filesystemrZ	pip.wheelrrZ	getLoggerrprTrr`r9r9r9r:�<module>s8

,