HEX
Server: nginx/1.24.0
System: Linux webserver 6.8.0-87-generic #88-Ubuntu SMP PREEMPT_DYNAMIC Sat Oct 11 09:28:41 UTC 2025 x86_64
User: wpuser (1002)
PHP: 8.3.6
Disabled: NONE
Upload Files
File: //lib/python3/dist-packages/pip/_internal/commands/__pycache__/install.cpython-312.pyc
�

��hnp��^�ddlZddlZddlZddlZddlZddlZddlmZmZddl	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�ZCGd�de�ZD					d-deEdeeFdeeFdeEdeeFd e
eFfd!�ZGdeeFdeEd eEfd"�ZH				d.d#eeEd$eeFd%eeFd&eeFd'eEd eEfd(�ZId)eJd*eEd+eEd eFfd,�ZKy)/�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��eZdZdZdZdd�Zededee	de
fd��Zd	e	d
ede
ddfd�Zd
eedeefd�Zdede	ddfd�Zy)�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> ...�returnNc���|jjtj��|jjtj��|jjtj
��|jjtj��|jjtj��|jjddddd��|jjddd	d
dd��tj|j�|jjd
ddd��|jjdddt��|jjddd
dd��|jjddd
dd��|jjtj��|jjddddd��|jjddddd gd!�"�|jjd#d$dd%��|jjd&d'd(dd)��|jjtj��|jjtj��|jjtj��|jjtj��|jjtj��|jjtj ��|jjtj"��|jjtj$��|jjd*dd+d,d-��|jjd.dd+d/�0�|jjd1dd2d,d3��|jjd4dd5d,d6��|jjtj&��|jjtj(��|jjtj*��|jjtj,��|jjtj.��|jjtj0��tj2tj4|j6�}|j6j9d7|�|j6j9d7|j�|jjd8d9d:dd;��y)<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.)r0�metavarr1r2z--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.))r0r/r2z	--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).)r0r1�choicesr2z--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/r0r2z--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_optss  �@/usr/lib/python3/dist-packages/pip/_internal/commands/install.py�add_optionszInstallCommand.add_optionsHs����
�
� � ��!8�!8�!:�;��
�
� � ��!7�!7�!9�:��
�
� � ��!3�!3�!5�6��
�
� � ����!1�2��
�
� � ��!4�!4�!6�7��
�
� � �����1�
	!�
	
�	
�
�
� � ������%�	!�	
�	�,�,�T�]�]�;��
�
� � �� ��%�	!�
	
�	
�
�
� � �� � ��		!�	
�	
�
�
� � �����P�	!�	
�	
�
�
� � ������
	!�	
� 	
�
�
� � ����!1�2��
�
� � �����)�
	!�
	
�	
�
�
� � � �#�$�%�w�/�G�
	!�	
� 	
�
�
� � ��"��N�		!�	
�	
�
�
� � �� �#��4�
	!�	
�	
�
�
� � ��!B�!B�!D�E��
�
� � ��!>�!>�!@�A��
�
� � ��!6�!6�!8�9��
�
� � ��!9�!9�!;�<��
�
� � ��!<�!<�!>�?��
�
� � ��!G�!G�!I�J��
�
� � ��!;�!;�!=�>��
�
� � ��!:�!:�!<�=��
�
� � �����:�	!�	
�	
�
�
� � �� ��A�		!�	
�	
�
�
� � �'� �'��C�	!�	
�	
�
�
� � �!� �'��8�	!�	
�	
�
�
� � ��!5�!5�!7�8��
�
� � ��!7�!7�!9�:��
�
� � ��!9�!9�!;�<��
�
� � ��!:�!:�!<�=��
�
� � ��!8�!8�!:�;��
�
� � ��!<�!<�!>�?��1�1��"�"��K�K�
�
�
	
���'�'��:�6����'�'��4�=�=�9��
�
� � ��#���G�
	!�	
��options�argsc���|jr|j�td��|jxr|jxr.|j
duxr|jduxr|jdu}|r|js
t�d}|jr|j}tj|d��tjdt��t!|j|j|j|j
|j"��|_d}d}|jr�d|_t&j(j+|j�|_t&j(j-|j�r4t&j(j/|j�std��t1d�	�}|j(}|j3|�|j4xsg}|j7|�}t9|�}	|j;|||	|j<�
�}
|j3t?��}t1|j@dd��}	|jC|||
|�}
tE||
�tG|jH�}|
D]	}d|_%�|jM|||||
|j|jN�
�}|jQ||
|||j|j$|j<|jR||jT��
}|jW|
�|jY|
|j��}|jr�t[|j\�}|jdk(rt_|ja���nHtc|jdd��5}tejf|ja�|dd��ddd�|jrV|ji�tkd�|j\D��}|r"tmddjod�|D���tpS	|jsd�}|jtdu}ty|��|jzj}�D�cgc]}t|�r|��}}t�||dg|��\}}|r0t�dj�d jod!�|D�����|j�|�}d}|j�xr|j�}|r|j�|�}|j�}|js|jrd}t�|||j
||j||j|j��"�} t�|j||j
|j|j"�#�}!t�|!�}"| j�t�j�d$��%�g}#| D]D}$|$j�}%	|"j�|%�}&|&�|%�d|&j���}%|#j�|%��F|�"|j�||j�|��&�djo|#�}'|'rtmd'|'�|jr+|sJ�|j�|j||j�|j�d*k(r
t��tpS#1swY���xYw#tv$rd}Y���wxYwcc}w#t�$rY��wxYw#t�$rM}(|jNd(k\})t�|(|)|j�}*tj�|*|)�)�t�cYd}(~(Sd}(~(wwxYw)+Nz'Can not combine '--user' and '--target'zto-satisfy-onlyT)�check_targetzUsing %s)r9r3r8�
isolated_modez=Target path exists but is not a directory, will not continue.�target)�kind)re�session�
target_pythonrN�install)�deleterk�globally_managed)�temp_build_dirre�
build_trackerrl�finderr6�	verbosity)
�preparerrsre�wheel_cacher6r?rNr>r;rP)�check_supported_wheels�-)�data�wzutf-8)�encoding�F)�indent�ensure_asciic3�XK�|]"}|jd|jdf���$y�w)�name�versionN)�metadata��.0�rs  rb�	<genexpr>z%InstallCommand.run.<locals>.<genexpr>�s/����-���Z�Z��'����I�)>�?�-�s�(*zWould install %s� c3�>K�|]}dj|����y�w)rxN)�join)r��items  rbr�z%InstallCommand.run.<locals>.<genexpr>�s���� P�D����$�� P�s��pip)�
modifying_pip)rv�verify�
build_optionsrUzYCould not build wheels for {}, which is required to install pyproject.toml-based projectsz, c3�4K�|]}|j���y�w�N)r�r�s  rbr�z%InstallCommand.run.<locals>.<genexpr>�s����!A�Q�!�&�&�!A�s�)�root�home�prefixrAr6�	pycompile)�userr�r�r��isolatedr�)�key)�resolver_variantzSuccessfully installed %s�)�exc_info�warn)]r6r3rr.rCr8r9rSrr:r;r	�check_dist_restriction�logger�verboser!�decide_user_installrir?�os�path�abspath�exists�isdirr$�
enter_contextrU�get_default_sessionr
�_build_package_finderrNr�no_clean�get_requirementsrr�	cache_dir�permit_editable_wheels�make_requirement_preparerrt�
make_resolverr>rP�trace_basic_info�resolver�requirements_to_installr�to_dict�open�json�dump�#warn_legacy_versions_and_specifiers�sortedr#r�r�get_requirement�satisfied_by�KeyErrorr"rG�valuesr(r'r�format�get_installation_order�ignore_dependenciesrB�_determine_conflictsrArr@�get_lib_location_guessesr�sort�operator�
attrgetterr��get_distributionr��	Exception�append�_warn_about_conflicts�determine_resolver_variant�OSError�create_os_error_message�errorr�_handle_target_dirr[r)+r`rerf�#installing_into_current_environmentr;�target_temp_dir�target_temp_dir_pathrUrlrmrsrr�	directory�reqsrv�reqru�resolver�requirement_set�report�f�would_install_items�pip_reqr�r��
reqs_to_build�_�build_failures�
to_install�	conflicts�should_warn_about_conflictsrA�	installed�
lib_locations�env�items�resultr��installed_dist�installed_descr��show_traceback�messages+                                           rb�runzInstallCommand.run	s7��� � �W�%7�%7�%C��H�I�I����=�W�%=�%=�>�
,��!�!�T�)�
,��"�"�d�*�
,��#�#�t�+�		,�
0��7�7�$�&�,���?�?�&�7�7���)�)�'��E����z�?�#4�5� 3��!�!��+�+��)�)��'�'�!�/�/�!
���48��.2�����'+�G�$�!#������1C�1C�!D�G�������w�1�1�2��G�G�M�M�'�"4�"4�5�#�S���
,��:�O�#2�#7�#7� �����/� �/�/�5�2���*�*�7�3��*�7�3�
��+�+���'�#*�#A�#A�	,�
���*�*�+<�+>�?�
�!��'�'�'��!�
�	�e	��(�(��w���H�D�)�'�4�8�$�W�%6�%6�7�K�
�
2��-1��*�
2��5�5�(��+���%�3�3��.�.�6��H��)�)�!���'�%�3�3�!(�!9�!9�'.�'E�'E� '� 7� 7�!1�"�-�-�*��H�
�!�!�&�)�&�.�.���1C�1C�-C�/��O��'�'�+�O�,S�,S�T���+�+�s�2��F�N�N�$4�5��g�6�6��g�N�U�RS��	�	�&�.�.�"2�A�a�e�T�U���� �C�C�E�&,�-�,�D�D�-�'�#�'� �*���� P�<O� P�P����
=�)�9�9�%�@��!(� 4� 4�� <�
�4�=�Q�)�5�5�<�<�>���3�A�6���M��!&��'�� �-�!��A�~��'�<�<B�F��	�	�!A�.�!A�A�=���"�8�8��I�J�48�I��/�/�/�P�G�4P�4P�
(�+� �5�5�j�A�	�$+�#?�#?� ��!�!�W�%8�%8�',�$�*����&�&�)��*�*�%9�%�3�3�!�/�/�	�I�5��*�*�)��&�&��*�*� �.�.��M�"�-�0�C��N�N�x�2�2�6�:�N�;��E�#�
#���{�{���%(�%9�%9�$�%?�N�%�1�"&��q��)?�)?�(@�A�����T�"�
#��$��*�*��%)�%D�%D�W�%M�+��
!�X�X�e�_�N���/�"�� ���"�"�?��#�#��"�"�O�W�_�_�
��#�#�v�-��!���CU�U��(�
&� %�
�
&����D!����� �
	�!�^�^�q�0�N�-����%�%��G�

�L�L��>�L�:��L��
	�s��&E\
�4([�A)\
�[$�6\
�[6�"E$\
�$[;�+A\
�[!�\
�$[3�/\
�2[3�3\
�;	\�\
�\�\
�
	] �A]�] �] r3r�r:c���t|�g}td|j��}|j}|j}|j
}tjj|�r|j|�tjj|�r||k7r|j|�tjj|�r|j|�|D�]h}	t
j|	�D�]L}
|	|k(r8tjj||
��t�fd�|ddD��r�Atjj||
�}tjj|�r�|stjd|���tjj|�rtjd|���tjj|�rt!j"|�nt
j$|�t!j&tjj|	|
�|���O��ky)N�)r�c3�@�K�|]}|j�����y�wr�)�
startswith)r��s�ddirs  �rbr�z4InstallCommand._handle_target_dir.<locals>.<genexpr> s�����I�!�1�<�<��-�I�s����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�platlibryr�r�r��listdirr��anyr��warning�islinkr��shutil�rmtree�remove�move)
r`r3r�r:�lib_dir_list�scheme�purelib_dir�platlib_dir�data_dir�lib_dirr��target_item_dirr�s
            @rbr�z!InstallCommand._handle_target_dirs����	�:�����B�_�%9�%9�:���n�n���n�n���;�;��
�7�7�>�>�+�&�����,�
�7�7�>�>�+�&�;�+�+E�����,�
�7�7�>�>�(�#�����)�#�	J�G��
�
�7�+�
J���h�&��7�7�<�<��$�7�D��I�|�C�R�7H�I�I� �"$�'�'�,�,�z�4�"@���7�7�>�>�/�2�"����>�+��
!��w�w�~�~�o�6����'�,��!��w�w�}�}�_�5��
�
�o�6��	�	�/�2����B�G�G�L�L��$�7��I�9
J�	Jrdr�c�b�	t|�S#t$rtjd�YywxYw)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�s  rbr�z#InstallCommand._determine_conflicts;s:��	�*�:�6�6���	����N�
��	�s�

�.�.�conflict_detailsr�c���|\}\}}|s|syg}|dk(r|jd�n|dk(sJ�|jd�|D]3}||d}||D]!}	|�d|�d|	d�d	�}
|j|
��#�5|D]G}||d}||D]5\}}}
d
j|||
|||dk(rdnd�
�}
|j|
��7�Itjdj	|��y)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�r�r��criticalr�)r`rr��package_set�missing�conflicting�parts�project_namer��
dependencyr�rr	r�s              rbr�z$InstallCommand._warn_about_conflictsGsX��/?�+��+�g�{��{�����x�'��L�L�@�
�$�|�3�3�3��L�L�@�
�$�	&�L�!�,�/��2�G�%�l�3�
&�
�#�n�A�g�Y�j��A���H.�.�����W�%�
&�	&�(�	&�L�!�,�/��2�G�.9�,�.G�
&�*��+�s�F��&�%�#� #�%� +�"2�l�"B���
������W�%�
&�	&� 	����	�	�%�(�)rd)r+N)�__name__�
__module__�__qualname__�__doc__�usagercr
rr�str�intr�r$�boolr�rrrr�r��rdrbr*r*4s���
�
0�E�
�B�y�6�y��c��y�s�y��y�v4J��4J�0=�4J�HL�4J�	
�4J�l
��1�2�
�	�/�	"�
�0*� /�0*�CF�0*�	
�0*rdr*r�r�r�r�r�r+c�T�td|||||��}|j|jgS)Nr�)r�r�r�r�r�)rr�r�)r�r�r�r�r�r�s      rbr�r�zs5���
�
�
�
���
�F�
�N�N�F�N�N�+�+rdc	�N�td�tt||���D��S)Nc3�2K�|]}t|����y�wr�r)r��ds  rbr�z)site_packages_writable.<locals>.<genexpr>�s�����
�	�!���s��r�r�)�all�setr�rs  rb�site_packages_writabler"�s)�����-�4�(�K�L���rdr6r9r3r8ric��|�|stjd�y|r8|rtd��t�rt	d��tjd�y|�J�|s|rtjd�yt
jstjd�yt||�	�rtjd
�ytjd�y)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.
    z$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 disabledrz0Non-user install because site-packages writeablezMDefaulting to user installation because normal site-packages is not writeable)	r��debugrr&r�site�ENABLE_USER_SITEr"�info)r6r9r3r8ris     rbr�r��s���"	�!�M����;�<�����3��
� �!�#�6��
�	���7�8��� � � ��j����J�K��� � ����K�L���9�}�E����G�H��
�K�K�	��rdr�r��using_user_sitec��g}|jd�|s,|jd�|jt|��n|jd�|dxxdz
cc<|jtjk(rUd}d}t	�s%|s#|j|d|j
�g�n|j|�|jd	�trR|jtjk(r5|jr)t|j�d
kDr|jd�dj|�j�dzS)
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�r(r�user_option_part�permissions_parts      rbr�r��s��
�E�
�L�L�?�@��
���T��
���S��Z� �
���S��
�"�I���I�
�{�{�e�l�l�"�?��2��'�)�/��L�L�$��$�*�*�,��
�
�L�L�)�*�
���U��
	��K�K�5�<�<�'��N�N������#�%�
���
?�	
��7�7�5�>���!�D�(�(rd)FNNFN)NNNF)Lr+r�r�r�r�r%�optparserr�typingrr�pip._vendor.richr�pip._internal.cacher�pip._internal.clir	�pip._internal.cli.cmdoptionsr
�pip._internal.cli.req_commandrrr
�pip._internal.cli.status_codesrr�pip._internal.exceptionsrr�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.miscrr r!r"r#�pip._internal.utils.temp_dirr$�pip._internal.utils.virtualenvr%r&�pip._internal.wheel_builderr'r(rr�r*rrr�r"r�r�r�rrdrb�<module>rLs������	�
��*�!�'�*�(�;���
:�D�.�2�G�J�S�0��/�<�1���7��P�	�8�	��C	*�'�C	*�N���� �,�
�,�
�3�-�,��3�-�,��	,�

�S�M�,�
�#�Y�
,�$��#���$��4��"&� $�#��:��D�>�:��#��:���
�:���}�	:�
�:�
�
:�z6)��6)�$(�6)�;?�6)��6)rd