HEX
Server: LiteSpeed
System: Linux php-prod-1.spaceapp.ru 5.15.0-157-generic #167-Ubuntu SMP Wed Sep 17 21:35:53 UTC 2025 x86_64
User: xnsbb3110 (1041)
PHP: 8.1.33
Disabled: NONE
Upload Files
File: //usr/local/lib/python3.10/dist-packages/pip/_internal/commands/__pycache__/install.cpython-310.pyc
o

��h�u�@sddlmZddlZddlZddlZddlZddlZddlZddlm	Z	m
Z
ddlmZddl
mZddlmZddlmZddlZddlmZdd	lmZdd
lmZddlmZmZddlmZm Z dd
l!m"Z"m#Z#m$Z$ddl%m&Z&ddl'm(Z(ddl)m*Z*ddl+m,Z,ddl-m.Z.m/Z/ddl0m1Z1ddl2m3Z3m4Z4ddl5m6Z6ddl7m8Z8ddl9m:Z:ddl;m<Z<m=Z=m>Z>m?Z?m@Z@mAZAddlBmCZCddlDmEZEmFZFddlGmHZHmIZIe:eJ�ZKGdd�de�ZL					d;d<d(d)�ZMd=d*d+�ZN				d>d?d2d3�ZOd@d9d:�ZPdS)A�)�annotationsN)�
SUPPRESS_HELP�Values)�Path)�canonicalize_name)�InvalidProxyURL)�
print_json)�
WheelCache)�
cmdoptions)�make_target_python)�RequirementCommand�with_cleanup)�ERROR�SUCCESS)�CommandError�InstallationError�InstallWheelBuildError)�
get_scheme)�get_environment)�InstallationReport)�get_build_tracker)�ConflictDetails�check_install_conflicts)�install_given_reqs)�InstallRequirement�check_legacy_setup_py_options)�WINDOWS��test_writable_dir)�	getLogger)�check_externally_managed�
ensure_dir�get_pip_version�(protect_pip_from_modification_on_windows�warn_if_run_as_root�write_output)�
TempDirectory)�running_under_virtualenv�virtualenv_no_global)�build� should_build_for_install_commandc@sJeZdZdZdZd!dd�Zed"dd
��Zd#dd�Zd$dd�Z	d%dd�Z
d 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.
    a%
      %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> ...�return�NonecCs�|j�t���|j�t���|j�t���|j�t���|j�t���|jjdddddd�|jjddd	d
ddd�t�|j�|jjd
dddd�|jjdddt	d�|jjddd
ddd�|jjddd
ddd�|j�t�
��|jjdddddd�|jjddddd gd!d"�|jjd#d$dd%d�|jjd&d'd(dd)d�|j�t���|j�t���|j�t�
��|j�t���|j�t���|j�t���|j�t���|j�t���|jjd*dd+d,d-d�|jjd.dd+d/d0�|jjd1dd2d,d3d�|jjd4dd5d,d6d�|j�t���|j�t���|j�t���|j�t���|j�t���|j�t���t�tj|j�}|j�d7|�|j�d7|j�|jjd8d9d:dd;d�dS)<Nz	--dry-run�
store_true�dry_runFz�Don't actually install anything, just print what would be. Can be used in combination with --ignore-installed to 'resolve' the requirements.)�action�dest�default�helpz-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.)r1�metavarr2r3z--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.))r1r0r3z	--no-user�store_falsez--root�	root_pathz=Install everything relative to this alternate root directory.z--prefix�prefix_patha[Installation prefix where lib, bin and other top-level folders are placed. Note that the resulting installation may contain scripts and other resources which reference the Python interpreter of pip, and not that of ``--prefix``. See also the ``--python`` option if the intention is to install packages into another (possibly pip-free) environment.z-Uz	--upgrade�upgradez�Upgrade all specified packages to the newest available version. The handling of dependencies depends on the upgrade-strategy used.z--upgrade-strategy�upgrade_strategyzonly-if-needed�eageraGDetermines 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).)r1r2�choicesr3z--force-reinstall�force_reinstallz;Reinstall all packages even if they are already up-to-date.z-Iz--ignore-installed�ignore_installedz�Ignore 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	--compile�compileTz'Compile Python source files to bytecodez--no-compilez.Do not compile Python source files to bytecode)r0r1r3z--no-warn-script-location�warn_script_locationz0Do not warn when installing scripts outside PATHz--no-warn-conflicts�warn_about_conflictsz%Do not warn about broken dependenciesrz--report�json_report_file�fileaWGenerate a JSON file describing what pip did to install the provided requirements. Can be used in combination with --dry-run and --ignore-installed to 'resolve' the requirements. When - is used as file name it writes to stdout. When writing to stdout, please combine with the --quiet option to avoid mixing pip logging output with JSON output.)�cmd_opts�
add_optionr
�requirements�constraints�no_deps�pre�editable�add_target_python_optionsr�src�ignore_requires_python�no_build_isolation�
use_pep517�
no_use_pep517�check_build_deps�override_externally_managed�config_settings�global_options�	no_binary�only_binary�
prefer_binary�require_hashes�progress_bar�root_user_action�make_option_group�index_group�parser�insert_option_group)�self�
index_opts�rc�I/usr/local/lib/python3.10/dist-packages/pip/_internal/commands/install.py�add_optionsWs��
��������
�����
�zInstallCommand.add_options�optionsr�args�	list[str]�intc-
Cs�|jr|jdurtd��|jo|jo!|jduo!|jduo!|jdu}|r*|js*t�d}|j	r2|j
}tj|dd�t
�dt��t|j|j|j|j|jd�|_d}d}|jr�d|_tj�|j�|_tj�|j�rstj�|j�sstd��tdd	�}|j}|�|�|jp�g}|�|�}t|�}	|j|||	|jd
�}
|�t��}t|j ddd�}�z�|�!|||
|�}
t"||
�t#|j$�}|
D]}d|_%q�|j&|||||
|j|j'd
�}|j(||
|||j|j|j|j)||j*|j+d�}|�,|
�|j-|
|jd�}|j�r0t.|j/�}|jdk�rt0|�1�d�n$t2|jddd��}t3j4|�1�|ddd�Wd�n	1�s+wY|j�rQt5dd�|j/D��}|�rNt6dd�7dd�|D���t8WSz|�9d�}Wnt:�ydd}Ynw|j;du}t<|d�dd �|j/D�}t=||dg|d!�\}}|�r�t>|��|�?|�}d}|j@�o�|jA}|�r�|�B|�}|jC}|j�s�|j�r�d}tD|||j||j||j|jE|jFd"�	}tG|j||j|j|jd#�} tH| �}!|jItJ�Kd$�d%�g}"i}#|!�L�D]	}$|$jM|#|$jN<�q�|D] }%|%jO}&|#�PtQ|&�d�}'|'�r|&�d|'��}(n|&}(|"�R|(��q�|du�r|jS||�T|�d&�d�7|"�})|)�r*t6d'|)�Wn(tU�yS}*z|j'd(k}+tV|*|+|j�},t
jW|,|+d)�tXWYd}*~*Sd}*~*ww|j�rf|�s]J�|�Y|j||j	�|jZd*k�rot[�t8S)+Nz'Can not combine '--user' and '--target'zto-satisfy-onlyT)�check_targetzUsing %s)r:r4r9�
isolated_modez=Target path exists but is not a directory, will not continue.�target)�kind)rf�session�
target_pythonrO�install)�deleterm�globally_managed)�temp_build_dirrf�
build_trackerrn�finderr7�	verbosity)�preparerrurf�wheel_cacher7r@rOr?r<rQ�py_version_info)�check_supported_wheels�-)�data�wzutf-8)�encoding�F)�indent�ensure_asciicss$�|]
}|jd|jdfVqdS)�name�versionN)�metadata��.0�rrcrcrd�	<genexpr>�s
��
�z%InstallCommand.run.<locals>.<genexpr>zWould install %s� css�|]}d�|�VqdS)r{N)�join)r��itemrcrcrdr�����pip)�
modifying_pipcSsg|]}t|�r|�qSrc)r*r�rcrcrd�
<listcomp>�s��z&InstallCommand.run.<locals>.<listcomp>)rx�verify�
build_optionsrV)�root�home�prefixrBr7�	pycompiler[)�userr�r�r��isolatedr�)�key)�resolver_variantzSuccessfully installed %s�)�exc_info�warn)\r7r4rr/rDr9r:rTr r;r<r
�check_dist_restriction�logger�verboser"�decide_user_installrkr@�os�path�abspath�exists�isdirr&�
enter_contextrV�get_default_sessionr�_build_package_finderrOr�no_clean�get_requirementsrr	�	cache_dir�permit_editable_wheels�make_requirement_preparerrv�
make_resolverr?rQ�python_version�trace_basic_info�resolver�requirements_to_installr�to_dict�open�json�dump�sortedr%r�r�get_requirement�KeyError�satisfied_byr#r)r�get_installation_order�ignore_dependenciesrC�_determine_conflictsrBrrAr[�get_lib_location_guessesr�sort�operator�
attrgetter�iter_all_distributionsr��canonical_namer��getr�append�_warn_about_conflicts�determine_resolver_variant�OSError�create_os_error_message�errorr�_handle_target_dirr\r$)-rarfrg�#installing_into_current_environmentr<�target_temp_dir�target_temp_dir_pathrVrnrorurt�	directory�reqsrx�reqrw�resolver�requirement_set�report�f�would_install_items�pip_reqr��
reqs_to_build�_�build_failures�
to_install�	conflicts�should_warn_about_conflictsrB�	installed�
lib_locations�env�summary�installed_versions�distribution�package�display_namer��text�installed_descr��show_traceback�messagercrcrd�runs����������



��

�	�
�
����

�
�
�
��
�
��
���

�zInstallCommand.runr4�strr�r&r;�boolcsHt|�g}td|jd�}|j}|j}|j}tj�|�r!|�|�tj�|�r0||kr0|�|�tj�|�r;|�|�|D]d}	t�	|	�D]\}
|	|kratj�
||
��t�fdd�|dd�D��raqDtj�
||
�}tj�|�r�|swt�
d|�qDtj�|�r�t�
d|�qDtj�|�r�t�|�nt�|�t�tj�
|	|
�|�qDq=dS)N�)r�c3s�|]}|���VqdS�N)�
startswith)r��s��ddirrcrdr�-r�z4InstallCommand._handle_target_dir.<locals>.<genexpr>���zKTarget 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.)r!rr��purelib�platlibr|r�r�r��listdirr��anyr��warning�islinkr��shutil�rmtree�remove�move)rar4r�r;�lib_dir_list�scheme�purelib_dir�platlib_dir�data_dir�lib_dirr��target_item_dirrcr�rdr�sL


��
��z!InstallCommand._handle_target_dirr��list[InstallRequirement]�ConflictDetails | NonecCs*zt|�WStyt�d�YdSw)NzwError while checking for conflicts. Please file an issue on pip's issue tracker: https://github.com/pypa/pip/issues/new)r�	Exceptionr��	exception)rar�rcrcrdr�Hs
��z#InstallCommand._determine_conflicts�conflict_detailsrr�c
Cs�|\}\}}|s|sdSg}|dkr|�d�n|dksJ�|�d�|D]!}||d}||D]}	|�d|�d|	d�d	�}
|�|
�q1q%|D](}||d}||D]\}}}
d
j|||
|||dkrgdndd
�}
|�|
�qUqIt�d�|��dS)N�legacyz�pip's legacy dependency resolver does not consider dependency conflicts when selecting packages. This behaviour is the source of the following dependency conflicts.�
resolvelibz�pip's dependency resolver does not currently take into account all the packages that are installed. This behaviour is the source of the following dependency conflicts.rr�z
 requires r�z, which is not installed.zg{name} {version} requires {requirement}, but {you} have {dep_name} {dep_version} which is incompatible.�youzyou'll)r�r��requirement�dep_name�dep_versionr�
)r��formatr��criticalr�)rar	r��package_set�missing�conflicting�parts�project_namer��
dependencyr�rrr�rcrcrdr�TsD������z$InstallCommand._warn_about_conflictsN)r,r-)rfrrgrhr,ri)r4r�r�r&r;r�r,r-)r�rr,r)r	rr�r�r,r-)�__name__�
__module__�__qualname__�__doc__�usagerer
r�r�r�r�rcrcrcrdr+Cs
B
z
6r+Fr�r�r��
str | Noner�r�r�r,rhcCs td|||||d�}|j|jgS)Nr�)r�r�r�r�r�)rr�r�)r�r�r�r�r�r�rcrcrdr��s�r�cCstdd�tt||d��D��S)Ncss�|]}t|�VqdSr�r)r��drcrcrdr��s
��
�z)site_packages_writable.<locals>.<genexpr>�r�r�)�all�setr�r rcrcrd�site_packages_writable�s�r#r7�bool | Noner:r4r9rkcCs�|dur
|s
t�d�dS|r#|rtd��t�rtd��t�d�dS|dus)J�|s-|r4t�d�dStjs>t�d	�dSt||d
�rKt�d�dSt�d�dS)
aZDetermine whether to do a user install based on the input options.

    If use_user_site is False, no additional checks are done.
    If use_user_site is True, it is checked for compatibility with other
    options.
    If use_user_site is None, the default behaviour depends on the environment,
    which is provided by the other arguments.
    Nz$Non-user install by explicit requestFzVCan 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 User install by explicit requestTz3Non-user install due to --prefix or --target optionz4Non-user install because user site-packages disabledr z0Non-user install because site-packages writeablezMDefaulting to user installation because normal site-packages is not writeable)	r��debugrr(r�site�ENABLE_USER_SITEr#�info)r7r:r4r9rkrcrcrdr��s8
��



�r�r�r�r��using_user_siter�cCsg}|�d�|s|�d�|�t|��n|�d�|dd7<|jtjkrGd}d}t�s=|s=|�|d|��g�n|�|�|�d	�t|�turW|�d
�|�d	�t	r�|jtj
tjfvr�|jr�t
dd�t|j�jD��rw|�d
�t|j�dkr�|�d�d�|���dS)zrFormat an error message for an OSError

    It may occur anytime during the execution of the install command.
    z,Could not install packages due to an OSErrorz: �.r�rz"Consider using the `--user` optionzCheck the permissionsz or z.
zHConsider checking your local proxy configuration with "pip config debug"css�|]	}t|�dkVqdS)�N)�len)r��partrcrcrdr�s�z*create_os_error_message.<locals>.<genexpr>z�HINT: This error might be caused by a file or folder name exceeding 255 characters, which is a Windows limitation even if long paths are enabled.
 iz�HINT: This error might have occurred since this system does not have Windows Long Path support enabled. You can find information on how to enable this at https://pip.pypa.io/warnings/enable-long-paths
r�)r�r��errno�EACCESr'�extend�lower�typerr�EINVAL�ENOENT�filenamer�rrr,r��strip)r�r�r)r�user_option_part�permissions_partrcrcrdr��sD



��

�
��r�)FNNFN)r�r�r�rr�rr�r�r�rr,rh)r�rr�r�r,r�)NNNF)r7r$r:rr4rr9rrkr�r,r�)r�r�r�r�r)r�r,r�)Q�
__future__rr.r�r�r�r�r&�optparserr�pathlibr�pip._vendor.packaging.utilsr�pip._vendor.requests.exceptionsr�pip._vendor.richr�!pip._internal.self_outdated_checkr��pip._internal.cacher	�pip._internal.clir
�pip._internal.cli.cmdoptionsr�pip._internal.cli.req_commandrr
�pip._internal.cli.status_codesrr�pip._internal.exceptionsrrr�pip._internal.locationsr�pip._internal.metadatar�(pip._internal.models.installation_reportr�,pip._internal.operations.build.build_trackerr�pip._internal.operations.checkrr�pip._internal.reqr�pip._internal.req.req_installrr�pip._internal.utils.compatr�pip._internal.utils.filesystemr�pip._internal.utils.loggingr�pip._internal.utils.miscr r!r"r#r$r%�pip._internal.utils.temp_dirr&�pip._internal.utils.virtualenvr'r(�pip._internal.wheel_builderr)r*rr�r+r�r#r�r�rcrcrcrd�<module>sh I�
	�=