3 �˜‚]•Fã @s ddlmZddlZddlZddlZddlZddlZddlZy ddlZWne k r`dZYnXddl m Z ddl m Z ddlmZmZddlmZmZmZddlmZddlmZmZdd lmZdd lmZdd lmZdd l m!Z!m"Z"dd lm#Z#ej$e%ƒZ&Gdd„de ƒZ'dd„Z(dS)é)Úabsolute_importN)ÚRequirementSet)ÚRequirementCommand)Úvirtualenv_no_globalÚdistutils_scheme)ÚInstallationErrorÚ CommandErrorÚPreviousBuildDirError)Ú cmdoptions)Ú ensure_dirÚget_installed_version)ÚBuildDirectory)ÚRemovedInPip10Warning)Úcheck_path_owner)Ú WheelCacheÚ WheelBuilder)Úrunning_under_virtualenvcs4eZdZdZdZdZdZ‡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] [package-index-options] ... %prog [options] -r [package-index-options] ... %prog [options] [-e] ... %prog [options] [-e] ... %prog [options] ...zInstall packages.c sPtt|ƒj||Žd}tƒr d}tjƒdkr0d}|j}|jtj ƒƒ|jtj ƒƒ|jtj ƒƒ|jtj ƒƒ|jddddddd �|jd d d d ddddd �|jtj ƒƒ|jdddddd�|jdddddgdd�|jddddd�|jdd d!d|d"d#�|jtjƒƒ|jtjƒƒ|jtjƒƒ|jtjƒƒ|jd$d%d|d&d#�|jd'd%d(d)d�|jd*d+dd,d�|jd-d.ddd/d �|jd0d1ddd2d �|jd3dd4dd5d6�|jd7d(d4d8d9�|jtjƒƒ|jtjƒƒ|jtjƒƒ|jtjƒƒ|jtjƒƒ|jtjƒƒ|jtjƒƒtjtj|jƒ}|jjd|ƒ|jjd|ƒdS):NTFrz-tz--targetÚ target_dirÚdirz¥Install packages into . By default this will not replace existing files/folders in . Use --upgrade to replace existing packages in with new versions.)ÚdestÚmetavarÚdefaultÚhelpz-dz --downloadz--download-dirz--download-directoryÚ download_dirz`Download packages into 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_strategyÚeagerzonly-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).)rrrrz--userÚ use_user_siteaInstall 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.) On Debian systems, this is the default when running outside of a virtual environment and not as root.z--systemÚ store_falsezDInstall using the system scheme (overrides --user on Debian systems)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--prefixÚ prefix_pathzIInstallation prefix where lib, bin and other top-level folders are placedz --compileÚcompilezCompile py files to pyc)rrrrz --no-compilezDo not compile py files to pyc)rrr)ÚsuperrÚ__init__rÚosÚgeteuidÚcmd_optsÚ add_optionr Ú constraintsÚeditableÚ requirementsÚ build_dirÚsrcÚignore_requires_pythonÚno_depsÚinstall_optionsÚglobal_optionsÚ use_wheelÚ no_use_wheelÚ no_binaryÚ only_binaryÚpreÚno_cleanÚrequire_hashesÚmake_option_groupÚ index_groupÚparserÚinsert_option_group)ÚselfÚargsÚkwÚ default_userr.Ú index_opts)Ú __class__©ú3/tmp/pip-build-8jg9gmni/pip/pip/commands/install.pyr+7sÊ zInstallCommand.__init__c&CsÜtj|ƒtj|ƒ|jr&tjdtƒ|jr8tjdtƒ|jrJtjdtƒ|j r\tjdtƒ|j rttjdtƒd|_ |j rŠt jj|j ƒ|_ t jj|jƒ|_|jp¢g}|jrÚ|jr¸tdƒ‚tƒrÆtdƒ‚|jd ƒ|jd ƒd}|j�rdƒd�}g}xX|D]P}|j2}y"t?|j2| ƒ}|�rî|d|7}Wnt@k �rYnX|j|ƒ�qÄWdjA|ƒ}|�r^t%jBd|ƒn(djAdd„| jCDƒƒ}|�r^t%jBd|ƒWntDk �r~d|_ ‚YnXWd|j �s”| jEƒXWdQRXWdQRX|j�rØtF|jƒg}tGd|d�d}tGd|d�d}t jj|ƒ�rø|j|ƒt jj|ƒ�r||k�r|j|ƒx²|D]ª}x¢t jH|ƒD]”}t jjA|j|ƒ}t jj|ƒ�r¬|j)�sjt%j&d |ƒ�q0t jjI|ƒ�rˆt%j&d!|ƒ�q0t jj|ƒ�r¢tJjK|ƒn t jL|ƒtJjMt jjA||ƒ|ƒ�q0W�q WtJjK|ƒ| S)"NzÉ--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)r3Úsrc_dirrrrr&r#Úignore_dependenciesr5r"r$rÚsessionÚ pycompileÚisolatedÚ wheel_cacher?)Ú build_optionsr8)Ú autobuilding)ÚrootÚprefix)ÚuserÚhomerUrVrQÚname)Úkeyú-ú zSuccessfully installed %scSsg|] }|j‘qSrJ)rY)Ú.0ÚreqrJrJrKú †sz&InstallCommand.run..zSuccessfully downloaded %sÚ)rXÚ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.)Nr Úresolve_wheel_no_use_binaryÚcheck_install_build_globalr&ÚwarningsÚwarnrÚallow_externalÚallow_all_externalÚallow_unverifiedrr#r3r,ÚpathÚabspathrMr7r$r(rrrÚappendrÚtempfileÚmkdtempÚexistsÚisdirr8Ú_build_sessionÚ_build_package_finderr>rÚ cache_dirÚformat_controlrÚloggerÚwarningr rrrrNr5r"r)Ú isolated_moder?Úpopulate_requirement_setrYÚhas_requirementsÚwheelÚ prepare_filesrÚbuildrr'Úget_lib_location_guessesÚsortedÚsuccessfully_installedÚoperatorÚ attrgetterr Ú ExceptionÚjoinÚinfoÚsuccessfully_downloadedr Ú cleanup_filesr rÚlistdirÚislinkÚshutilÚrmtreeÚremoveÚmove)rDÚoptionsrEr7Útemp_target_dirr8rOÚfinderÚ build_deleterRr3Úrequirement_setÚwbÚpossible_lib_locationsÚreqsÚitemsr^ÚitemÚinstalled_versionÚ installedÚ downloadedÚ lib_dir_listÚ purelib_dirÚ platlib_dirÚlib_dirÚtarget_item_dirrJrJrKÚrunÒsD                            zInstallCommand.run) Ú__name__Ú __module__Ú __qualname__Ú__doc__rYÚusageÚsummaryr+rŸÚ __classcell__rJrJ)rIrKr s  rcOstd|ž|Ž}|d|dgS)Nr`rarb)r`)r)rEÚkwargsÚschemerJrJrKr}Åsr}))Ú __future__rÚloggingr€r,rmr‰rerzÚ ImportErrorÚpip.reqrÚpip.basecommandrÚ pip.locationsrrÚpip.exceptionsrrr Úpipr Ú pip.utilsr r Úpip.utils.buildr Zpip.utils.deprecationrÚpip.utils.filesystemrÚ pip.wheelrrrÚ getLoggerr rurr}rJrJrJrKÚs6           (