a
ljl @ sH d dl Z d dlZd dlZd dlZd dlZd dlmZmZ d dlm Z m
Z
mZ d dlm
Z
d dlmZ d dlmZ d dlmZ d dlmZmZmZ d d lmZmZ d d
lmZmZ d dlmZ d dl m!Z! d d
l"m#Z# d dl$m%Z%m&Z& d dl'm(Z( d dl)m*Z* d dl+m,Z, d dl-m.Z. d dl/m0Z0 d dl1m2Z2 d dl3m4Z4 d dl5m6Z6m7Z7m8Z8m9Z9 d dl:m;Z; d dlZ> d dl?m@Z@mAZAmBZB e4eCZDe#e@dddZEG dd deZFd/eGeeH eeH eGeeH e
eH d d!d"ZIeeH eGeGd#d$d%ZJd0eeG eeH eeH eeH eGeGd&d'd(ZKe
e* ee
eH dd)d*d+ZLeMeGeGeHd,d-d.ZNdS )1 N)
SUPPRESS_HELPValues)IterableListOptional)canonicalize_name)
WheelCache)
cmdoptions)make_target_python)RequirementCommandwarn_if_run_as_rootwith_cleanup)ERRORSUCCESS)CommandErrorInstallationError)
get_scheme)get_environment)
FormatControl)ConflictDetailscheck_install_conflicts)install_given_reqs)InstallRequirement)get_requirement_tracker)WINDOWS)parse_distutils_argstest_writable_dir) getLogger)
ensure_dirget_pip_version(protect_pip_from_modification_on_windowswrite_output)
TempDirectory)running_under_virtualenvvirtualenv_no_global)BinaryAllowedPredicatebuild should_build_for_install_command)format_controlreturnc s t td fdd}|S )N)reqr* c s t | jp
d} |}d|v S )N Zbinary)r nameZget_allowed_formats)r+ Zcanonical_nameZallowed_formatsr) B/usr/lib/python3.9/site-packages/pip/_internal/commands/install.pycheck_binary_allowed5 s
z6get_check_binary_allowed..check_binary_allowed)r bool)r) r1 r/ r. r0 get_check_binary_allowed4 s r3 c @ sz e Zd ZdZdZddddZeeee e
ddd Ze ee
dd
ddZee ee d
ddZee ddddZdS )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.
a%
%prog [options] [package-index-options] ...
%prog [options] -r [package-index-options] ...
%prog [options] [-e] ...
%prog [options] [-e] ...
%prog [options] ...N)r* c C sj | j t | j t | j t | j t | j t | j jddddd dd t| j | j jddd d
d | j jddd
t d | j jdddd dd | j jdddd dd | j t
| j jdddd dd | j jdddddgdd | j jddd d d | j jd!d"d#d d$d | j t | j t | j t
| j t | j t | j t | j jd%d d&d'd(d) | j jd*d
d&d+d, | j jd-d
d.d'd/d) | j jd0d
d1d'd2d) | j t | j t | j t | j t | j t ttj| j}| jd3| | jd3| j d S )4Nz-tz--target
target_dirdirzInstall packages into . By default this will not replace existing files/folders in . Use --upgrade to replace existing packages in with new versions.)destmetavardefaulthelpz--user
use_user_site
store_truezInstall 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.))r7 actionr: z --no-userstore_falsez--root root_pathz=Install everything relative to this alternate root directory.z--prefixprefix_pathzIInstallation prefix where lib, bin and other top-level folders are placedz-Uz --upgradeupgradezUpgrade all specified packages to the newest available version. The handling of dependencies depends on the upgrade-strategy used.z--upgrade-strategyupgrade_strategyzonly-if-neededZeageraG Determines how dependency upgrading should be handled [default: %default]. "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).)r7 r9 choicesr: z--force-reinstallforce_reinstallz;Reinstall all packages even if they are already up-to-date.z-Iz--ignore-installedignore_installedzIgnore the installed packages, overwriting them. This can break your system if the existing package is of a different version or was installed with a different package manager!z --compilecompileTz'Compile Python source files to bytecode)r= r7 r9 r: z--no-compilez.Do not compile Python source files to bytecode)r= r7 r: z--no-warn-script-locationwarn_script_locationz0Do not warn when installing scripts outside PATHz--no-warn-conflictswarn_about_conflictsz%Do not warn about broken dependenciesr )Zcmd_optsZ
add_optionr requirementsconstraintsZno_depsZpreZeditableZadd_target_python_optionsr srcignore_requires_pythonZno_build_isolation
use_pep517Z
no_use_pep517install_optionsglobal_optionsZ no_binaryZonly_binaryZ
prefer_binaryZrequire_hashesZprogress_barZmake_option_groupZindex_groupparserZinsert_option_group)selfZ
index_optsr/ r/ r0 add_optionsQ s
zInstallCommand.add_options)optionsargsr* c ) s$ |j r|jd urtdt| d}|jr2|j}tj|dd |jpHg }t
dt t|j |j
|j|j|jd|_ d }d }|jrd|_tj|j|_tj|jrtj|jstdtdd }|j}| | |jpg }| |}t|} | j||| |jd
}
t|j|j}| t }t|j! ddd}
zx| "|||
|}|D ]}d|_#qLt$||j | j%|
||||
|j d
}| j&||
|||j |j|j|j'||j(d
}| )|
|j*||j d}z|+d}W n t,y d}Y n0 |j-d u }t.|d t/|
j fdd|j01 D }t2||dg g d\}}dd |D }|r^t3d4d5||D ]}|j(sbd|_6qb|7|}d }|j8 o|j9}|r| :|}|j;}|js|j
rd}t<||||j||j
||j |j=d }t>|j ||j|j
|jd}t?|} |j@tABdd g }!|D ]T}"|"jC}#z(| D|#}$|$d urN|# d|$jE }#W n tFyd Y n0 |!G|# q|d ur| jH|| I|d d 5|!}%|%rtJd!|% W nP tKy }& z6| jLd"k}'tM|&|'|j }(t jN|(|'d# tOW Y d }&~&S