HEX
Server: Apache
System: Linux zacp120.webway.host 4.18.0-553.50.1.lve.el8.x86_64 #1 SMP Thu Apr 17 19:10:24 UTC 2025 x86_64
User: govancoz (1003)
PHP: 8.3.26
Disabled: exec,system,passthru,shell_exec,proc_close,proc_open,dl,popen,show_source,posix_kill,posix_mkfifo,posix_getpwuid,posix_setpgid,posix_setsid,posix_setuid,posix_setgid,posix_seteuid,posix_setegid,posix_uname
Upload Files
File: //usr/local/lib/python3.7/site-packages/pip/_internal/commands/__pycache__/install.cpython-37.pyc
B

L��gnp�@sddlZddlZddlZddlZddlZddlZddlmZmZddl	m
Z
mZddlm
Z
ddlmZddlmZddlmZddlmZmZmZdd	lmZmZdd
lmZmZddlmZddl m!Z!dd
l"m#Z#ddl$m%Z%ddl&m'Z'm(Z(ddl)m*Z*ddl+m,Z,m-Z-ddl.m/Z/ddl0m1Z1ddl2m3Z3ddl4m5Z5m6Z6m7Z7m8Z8m9Z9ddl:m;Z;ddl<m=Z=m>Z>ddl?m@Z@mAZAe3eB�ZCGdd�de�ZDd(eEeeFeeFeEeeFe
eFd�dd�ZGeeFeEeEd�d d!�ZHd)eeEeeFeeFeeFeEeEd"�d#d$�ZIeJeEeEeFd%�d&d'�ZKdS)*�N)�
SUPPRESS_HELP�Values)�List�Optional)�
print_json)�
WheelCache)�
cmdoptions)�make_target_python)�RequirementCommand�warn_if_run_as_root�with_cleanup)�ERROR�SUCCESS)�CommandError�InstallationError)�
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�write_output)�
TempDirectory)�running_under_virtualenv�virtualenv_no_global)�build� should_build_for_install_commandc@szeZdZdZdZdd�dd�Zeeee	e
d�dd	��Ze	ee
dd
�dd�Zeeeed
�dd�Zee	dd�dd�ZdS)�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> ...N)�returncCs�|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.)r,�metavarr-r.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.))r,r+r.z	--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).)r,r-�choicesr.z--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)r+r,r.z--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_pep517Zcheck_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�r]�B/tmp/pip-unpacked-wheel-hv55ucu3/pip/_internal/commands/install.py�add_optionsHs�

zInstallCommand.add_options)�options�argsr(c*Cs�|jr|jdk	rtd��|jo"|joB|jdkoB|jdkoB|jdk}|rT|jsTt�d}|j	rd|j
}tj|dd�t
�dt��t|j|j|j|j|jd�|_d}d}|j�rd|_tj�|j�|_tj�|j�r�tj�|j�s�td��tdd	�}|j}|�|�|j�pg}|�|�}t|�}	|j|||	|jd
�}
|�t��}t|j ddd�}�y
|�!|||
|�}
t"||
�t#|j$�}x|
D]}d|_%�q�W|j&|||||
|j|j'd
�}|j(||
|||j|j|j|j)||j*d�
}|�+|
�|j,|
|jd�}|j�rPt-|j.�}|jdk�rt/|�0�d�n2t1|jddd��}t2j3|�0�|ddd�WdQRX|j�r�|�4�t5dd�|j.D��}|�r�t6dd�7dd�|D���t8Sy|�9d�}Wnt:k
�r�d}YnX|j;dk}t<|d�dd �|j=�>�D�}t?||dg|d!�\}}|�r$t@d"�Ad#�7d$d�|D�����|�B|�}d}|jC�o@|jD}|�rR|�E|�}|jF}|j�sh|j�rld}tG|||j||j||j|jHd%�}tI|j||j|j|jd&�} tJ| �}!|jKtL�Md'�d(�g}"x^|D]V}#|#jN}$y(|!�O|$�}%|%dk	�r�|$�d|%jP��}$WntQk
�rYnX|"�R|$��q�W|dk	�rB|jS||�T|�d)�d�7|"�}&|&�r\t6d*|&�WnJtUk
�r�}'z*|j'd+k}(tV|'|(|j�})t
jW|)|(d,�tXSd}'~'XYnX|j�r�|�s�tY�|�Z|j||j	�|j[d-k�r�t\�t8S).Nz'Can not combine '--user' and '--target'zto-satisfy-onlyT)�check_targetzUsing %s)r5r/r4�
isolated_modez=Target path exists but is not a directory, will not continue.�target)�kind)r`�session�
target_pythonrJ�install)�deletere�globally_managed)�temp_build_dirr`�
build_trackerrf�finderr2�	verbosity)
�preparerrmr`�wheel_cacher2r;rJr:r7rL)�check_supported_wheels�-)�data�wzutf-8)�encoding�F)�indent�ensure_asciicss"|]}|jd|jdfVqdS)�name�versionN)�metadata)�.0�rr]r]r^�	<genexpr>�sz%InstallCommand.run.<locals>.<genexpr>zWould install %s� css|]}d�|�VqdS)rrN)�join)r|�itemr]r]r^r~�s�pip)�
modifying_pipcSsg|]}t|�r|�qSr])r&)r|r}r]r]r^�
<listcomp>�sz&InstallCommand.run.<locals>.<listcomp>)rp�verify�
build_optionsrPzYCould not build wheels for {}, which is required to install pyproject.toml-based projectsz, css|]}|jVqdS)N)ry)r|r}r]r]r^r~�s)�root�home�prefixr=r2�	pycompile)�userr�r�r��isolatedry)�key)�resolver_variantzSuccessfully installed %s�)�exc_info�warn)]r2r/rr*r?r4r5rNrr6r7r�check_dist_restriction�logger�verboser�decide_user_installrcr;�os�path�abspath�exists�isdirr"�
enter_contextrP�get_default_sessionr	�_build_package_finderrJr�no_clean�get_requirementsrr�	cache_dirZpermit_editable_wheels�make_requirement_preparerrn�
make_resolverr:rL�trace_basic_info�resolverZrequirements_to_installr�to_dict�open�json�dumpZ#warn_legacy_versions_and_specifiers�sortedr!r�r�get_requirement�KeyError�satisfied_byr rC�valuesr%r�format�get_installation_order�ignore_dependenciesr>�_determine_conflictsr=rr<�get_lib_location_guessesr�sort�operator�
attrgetterry�get_distributionrz�	Exception�append�_warn_about_conflictsZdetermine_resolver_variant�OSError�create_os_error_message�errorr
�AssertionError�_handle_target_dirrVr)*r[r`raZ#installing_into_current_environmentr7�target_temp_dir�target_temp_dir_pathrPrfrgrmrl�	directory�reqsrp�reqro�resolver�requirement_set�report�fZwould_install_items�pip_reqr��
reqs_to_build�_�build_failures�
to_install�	conflicts�should_warn_about_conflictsr=�	installed�
lib_locations�env�items�resultr�Zinstalled_dist�installed_descr��show_traceback�messager]r]r^�run	sL













 














zInstallCommand.run)r/r�r6r(csVt|�g}td|jd�}|j}|j}|j}tj�|�rB|�|�tj�|�r`||kr`|�|�tj�|�rv|�|�x�|D]�}	x�t�	|	�D]�}
|	|kr�tj�
||
��t�fdd�|dd�D��r�q�tj�
||
�}tj�|��r4|s�t�
d|�q�tj�|��rt�
d|�q�tj�|��r*t�|�n
t�|�t�tj�
|	|
�|�q�Wq|WdS)N�)r�c3s|]}|���VqdS)N)�
startswith)r|�s)�ddirr]r^r~ sz4InstallCommand._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.)rrr��purelib�platlibrsr�r�r��listdirr��anyr��warning�islinkr��shutil�rmtree�remove�move)r[r/r�r6�lib_dir_list�scheme�purelib_dir�platlib_dir�data_dir�lib_dirr��target_item_dirr])r�r^r�sD




z!InstallCommand._handle_target_dir)r�r(cCs,yt|�Stk
r&t�d�dSXdS)NzwError while checking for conflicts. Please file an issue on pip's issue tracker: https://github.com/pypa/pip/issues/new)rr�r��	exception)r[r�r]r]r^r�;sz#InstallCommand._determine_conflicts)�conflict_detailsr�r(c
Cs|\}\}}|s|sdSg}|dkr0|�d�n|dks<t�|�d�xN|D]F}||d}x4||D](}	|�d|�d|	d�d	�}
|�|
�qfWqLWx\|D]T}||d}xB||D]6\}}}
d
j|||
|||dkr�dndd
�}
|�|
�q�Wq�Wt�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.rrz
 requires r�z, which is not installed.zg{name} {version} requires {requirement}, but {you} have {dep_name} {dep_version} which is incompatible.�youzyou'll)ryrz�requirement�dep_name�dep_versionr��
)r�r�r�r��criticalr�)r[r�r��package_set�missing�conflicting�parts�project_namerz�
dependencyr�r�r�r�r]r]r^r�Gs6

z$InstallCommand._warn_about_conflicts)�__name__�
__module__�__qualname__�__doc__�usager_rrr�str�intr�r"�boolr�rrrr�r�r]r]r]r^r'4sB}5r'F)r�r�r�r�r�r(cCs td|||||d�}|j|jgS)Nr�)r�r�r�r�r�)rr�r�)r�r�r�r�r�r�r]r]r^r�zsr�)r�r�r(cCstdd�tt||d��D��S)Ncss|]}t|�VqdS)N)r)r|�dr]r]r^r~�sz)site_packages_writable.<locals>.<genexpr>)r�r�)�all�setr�)r�r�r]r]r^�site_packages_writable�sr	)r2r5r/r4rcr(cCs�|dk	r|st�d�dS|rF|r*td��t�r8td��t�d�dS|dksRt�|sZ|rht�d�dStjs|t�d	�dSt||d
�r�t�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 disabled)r�r�z0Non-user install because site-packages writeablezMDefaulting to user installation because normal site-packages is not writeable)
r��debugrr$rr��site�ENABLE_USER_SITEr	�info)r2r5r/r4rcr]r]r^r��s2




r�)r�r��using_user_siter(cCs�g}|�d�|s,|�d�|�t|��n
|�d�|dd7<|jtjkr�d}d}t�sz|sz|�|d|��g�n
|�|�|�d	�tr�|jtjkr�|j	r�t
|j	�d
kr�|�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�r�z"Consider using the `--user` optionzCheck the permissionsz or z.
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�lowerr�ENOENT�filename�lenr��strip)r�r�rr��user_option_part�permissions_partr]r]r^r��s0





r�)FNNFN)NNNF)Lrr�r�r�r�r�optparserr�typingrrZpip._vendor.richr�pip._internal.cacherZpip._internal.clirZpip._internal.cli.cmdoptionsr	�pip._internal.cli.req_commandr
rr�pip._internal.cli.status_codesr
r�pip._internal.exceptionsrr�pip._internal.locationsrZpip._internal.metadatarZ(pip._internal.models.installation_reportrZ,pip._internal.operations.build.build_trackerr�pip._internal.operations.checkrrZpip._internal.reqrZpip._internal.req.req_installrr�pip._internal.utils.compatr�pip._internal.utils.filesystemr�pip._internal.utils.loggingr�pip._internal.utils.miscrrrr r!�pip._internal.utils.temp_dirr"�pip._internal.utils.virtualenvr#r$�pip._internal.wheel_builderr%r&r�r�r'rrr�r	r�r�r�r]r]r]r^�<module>s`K	8