HEX
Server: Microsoft-IIS/10.0
System: Windows NT ITPWINWEBSVR22 10.0 build 20348 (Windows Server 2022) AMD64
User: www.conferencesearch.co.uk (0)
PHP: 8.3.30
Disabled: NONE
Upload Files
File: D:/Python311/Lib/site-packages/pip/_internal/operations/__pycache__/prepare.cpython-311.pyc
�

�mi�p��T�dZddlmZddlZddlZddlZddlmZddlm	Z	ddl
mZddlm
Z
ddlmZdd	lmZdd
lmZddlmZddlmZmZmZmZmZmZmZdd
lmZddl m!Z!m"Z"ddl#m$Z$ddl%m&Z&ddl'm(Z(ddl)m*Z*ddl+m,Z,m-Z-ddl.m/Z/ddl0m1Z1ddl2m3Z3ddl4m5Z5ddl6m7Z7m8Z8ddl9m:Z:m;Z;ddl<m=Z=ddl>m?Z?m@Z@mAZAmBZBddlCmDZDddlEmFZFddlGmHZHe
rddlImJZJe5eK��ZLdEd+�ZMdFd3�ZNe	Gd4�d5����ZO		dGdHd<�ZP	dGdId=�ZQ		dGdJd?�ZR	dKdLdB�ZSGdC�dD��ZTdS)Mz(Prepares a distribution for installation�)�annotationsN)�Iterable)�	dataclass)�Path)�
TYPE_CHECKING)�canonicalize_name)�BuildEnvironmentInstaller)�)make_distribution_for_install_requirement)�InstalledDistribution)�DirectoryUrlHashUnsupported�HashMismatch�HashUnpinned�InstallationError�MetadataInconsistent�NetworkConnectionError�VcsHashUnsupported)�
PackageFinder)�BaseDistribution�get_metadata_distribution)�ArchiveInfo)�Link)�Wheel)�
Downloader)�HTTPRangeRequestUnsupported�dist_from_wheel_url)�
PipSession)�BuildTracker)�InstallRequirement)�	getLogger)�direct_url_for_editable�direct_url_from_link)�Hashes�
MissingHashes)�
indent_log)�display_path�	hash_file�hide_url�redact_auth_from_requirement)�
TempDirectory)�unpack_file)�vcs)�BarType�reqr�
build_trackerr�build_env_installerr	�build_isolation�bool�check_build_deps�returnrc���t|��}|j}|�E|�||��5|�|||��ddd��n#1swxYwY|���S)z(Prepare a distribution for installation.N)r
�build_tracker_id�track�prepare_distribution_metadatar)r-r.r/r0r2�
abstract_dist�
tracker_ids       �BD:\Python311\Lib\site-packages\pip/_internal/operations/prepare.py�_get_prepared_distributionr;As���>�c�B�B�M��/�J���
�
 �
 ��j�
1�
1�	�	��7�7�#�_�6F�
�
�
�	�	�	�	�	�	�	�	�	�	�	����	�	�	�	��2�2�4�4�4s�A�A�A�linkr�location�str�	verbosity�int�Nonec��tj|j��}|�J�|�|t	|j��|���dS)N)�urlr?)r+�get_backend_for_scheme�scheme�unpackr'rC)r<r=r?�vcs_backends    r:�unpack_vcs_linkrHSsK���,�T�[�9�9�K��"�"�"����x�X�d�h�%7�%7�9��M�M�M�M�M�c�0�eZdZUded<dZded<d	d�ZdS)
�Filer>�pathN�
str | None�content_typer3rAc��|j�8	tj|j��d|_dS#t$rYdSwxYwdS)Nr)rN�	mimetypes�
guess_typerL�OSError)�selfs r:�
__post_init__zFile.__post_init__^s^����	�
�$-�$8���$C�$C�A�$F��!�!�!���
�
�
����
����	�	s�$/�
=�=)r3rA)�__name__�
__module__�__qualname__�__annotations__rNrT�rIr:rKrKYsD�������
�I�I�I�#�L�#�#�#�#������rIrK�downloadr�download_dirrM�hashes�
Hashes | Nonec���tdd���}d}|rt|||��}|r|}d}n+|||j��\}}|r|�|��t	||��S)NrFT��kind�globally_managed)r)�_check_download_dirrL�check_against_pathrK)r<rZr[r\�temp_dir�already_downloaded_path�	from_pathrNs        r:�get_http_urlrghs����(�T�B�B�B�H�"���R�"5�d�L�&�"Q�"Q���1�+�	����#+�(�4���"?�"?��	�<��	1��%�%�i�0�0�0��	�<�(�(�(rIc��d}|rt|||��}|r|}n|j}|r|�|��t|d��S)z'Get file and optionally check its hash.N)rb�	file_pathrcrK)r<r[r\rerfs     r:�get_file_urlrj�si��
#���R�"5�d�L�&�"Q�"Q���#�+�	�	��N�	��-��!�!�)�,�,�,��	�4� � � rI�File | Nonec��|jrt|||���dS|���rJ�|jrt	|||���}nt||||���}|jst|j||j	��|S)a_Unpack link into location, downloading if required.

    :param hashes: A Hashes object, one of whose embedded hashes must match,
        or HashMismatch will be raised. If the Hashes is empty, no matches are
        required, and unhashable types of requirements (like VCS ones, which
        would ordinarily raise HashUnsupported) are allowed.
    )r?N�r\)
�is_vcsrH�is_existing_dir�is_filerjrg�is_wheelr*rLrN)r<r=rZr?r[r\�files       r:�
unpack_urlrs�s��� �{����h�)�<�<�<�<��t��#�#�%�%�%�%�%��|�

��D�,�v�>�>�>��������	
�
�
���=�<��D�I�x��):�;�;�;��KrIT�warn_on_hash_mismatchc�~�tj�||j��}tj�|��sdSt
�d|��|rY	|�|��nB#t$r5|rt
�	d|��tj
|��YdSwxYw|S)z�Check download_dir for previously downloaded file with correct hash
    If a correct file is found return its path else None
    NzFile was already downloaded %sz;Previously-downloaded file %s has bad hash. Re-downloading.)�osrL�join�filename�exists�logger�inforcr
�warning�unlink)r<r[r\rt�
download_paths     r:rbrb�s����G�L�L��t�}�=�=�M�
�7�>�>�-�(�(���t��K�K�0�-�@�@�@�
�
�		��%�%�m�4�4�4�4���	�	�	�$�
����Q�!����
�I�m�$�$�$��4�4�	�����s�%A;�;;B:�9B:c���eZdZdZd8�fd�Zd9d �Zd:d"�Zd;d$�Zd<d&�Zd<d'�Z	d=d*�Z
	d>d?d.�Z	d>d@d0�Z	d>dAd2�Z
d@d3�Zd9d4�ZdBd5�ZdCd7�Z�xZS)D�RequirementPreparerzPrepares a Requirement�	build_dirr>r[rM�src_dirr0r1�build_isolation_installerr	r2r.r�sessionr�progress_barr,�finderr�require_hashes�
use_user_site�
lazy_wheelr?r@�legacy_resolver�resume_retriesr3rAc�T��t�����||_||_||_||_t
||	|��|_|
|_||_	||_
||_||_||_
||_|
|_||_||_i|_d|_dS)N)�r�)�super�__init__r�r�r.�_sessionr�	_downloadr�r[r0r/r2r�r��use_lazy_wheelr?r��_downloaded�_previous_requirement_header)rSr�r[r�r0r�r2r.r�r�r�r�r�r�r?r�r��	__class__s                 �r:r�zRequirementPreparer.__init__�s����(	�����������"���*�����
�#�G�\�>�J�J������)��� /���#<�� �!1���-���+���)���#��� /���,.���-5��)�)�)rIr-rc��|jjr0|js)d}tt	|jj����}n,d}|jrt|j��nt|��}|jrM|jrFt|jt��r|j}n|j�
��}|r	|d|�d�z
}||f|jkr$||f|_t�
||��|jrNt��5t�
d|jj��ddd��dS#1swxYwYdSdS)z3Provide context for the requirement being prepared.z
Processing %sz
Collecting %sz (from �)zUsing cached %sN)r<rp�is_wheel_from_cacher>r%rir-r(�
comes_from�
isinstancerfr�rzr{r$rx)rSr-�message�informationr�s     r:�_log_preparing_linkz'RequirementPreparer._log_preparing_link!s����8��	Y�C�$;�	Y�%�G��l�3�8�+=�>�>�?�?�K�K�%�G�CF�7�X�6�s�w�?�?�?�PS�TW�PX�PX�K��7�	7�s�~�	7��#�.�#�.�.�
8�),��
�
� �^�5�5�7�7�
��
7��6��6�6�6�6���[�!�T�%F�F�	.�18�+�0F�D�-��K�K���-�-�-��"�	B����
B�
B����-�s�x�/@�A�A�A�
B�
B�
B�
B�
B�
B�
B�
B�
B�
B�
B�
B����
B�
B�
B�
B�
B�
B�	B�	Bs�&D6�6D:�=D:�parallel_buildsc���|jjrdS|j�J�|j���r|jj|_dS|�|jd|���|���dS)z1Ensure source_dir of a linked InstallRequirement.NT)�
autodeleter�)r<rq�
source_dirrori�ensure_has_source_dirr��ensure_pristine_source_checkout)rSr-r�s   r:�_ensure_link_req_src_dirz,RequirementPreparer._ensure_link_req_src_dir<s���
�8��	�
�F��~�%�%�%��8�#�#�%�%�	� �X�/�C�N��F�	�!�!��N��+�	"�	
�	
�	
�
	�+�+�-�-�-�-�-rIr"c�>�|js|�d���S|jjrt	���|j���rt
���|js|jst���|�d���p
t��S)NT)�trust_internetF)r�r\r<rnrror�	is_direct�	is_pinnedrr#�rSr-s  r:�_get_linked_req_hashesz*RequirementPreparer._get_linked_req_hashesSs����"�	3��:�:�T�:�2�2�2��8�?�	'�$�&�&�&��8�#�#�%�%�	0�-�/�/�/��}�	!�S�]�	!��.�.� ��z�z��z�/�/�B�=�?�?�BrI�BaseDistribution | Nonec���|jrt�d��dS|jrt�d��dS|�|��p|�|j��S)Nz9Metadata-only fetching is not used in the legacy resolverz?Metadata-only fetching is not used as hash checking is required)r�rz�debugr��$_fetch_metadata_using_link_data_attr� _fetch_metadata_using_lazy_wheelr<r�s  r:�_fetch_metadata_onlyz(RequirementPreparer._fetch_metadata_onlyss�����	��L�L�K�
�
�
��4���	��L�L�Q�
�
�
��4��8�8��
�
�=�
�
2�
2�3�8�
<�
<�	=rIc�R�|j���}|�dS|j�J�t�d|j|��t||j|������}t|j	d��5}|�
��}ddd��n#1swxYwYt||jj|jj
��}t|j��t|jj
��kr!t!|d|jj
|j���|S)zGFetch metadata from the data-dist-info-metadata attribute, if possible.Nz/Obtaining dependency information for %s from %srm�rb�Name)r<�
metadata_linkr-rz�verbosergr��	as_hashes�openrL�readrrx�namer�raw_namer)rSr-r��
metadata_file�f�metadata_contents�
metadata_dists       r:r�z8RequirementPreparer._fetch_metadata_using_link_data_attr�si����.�.�0�0�
��	��4��w�"�"�"����=��G��	
�	
�	
�%���N� �*�*�,�,�
�
�
�
�
�-�$�d�
+�
+�	)�q� !������	)�	)�	)�	)�	)�	)�	)�	)�	)�	)�	)����	)�	)�	)�	)�2���H���G�L�
�
�
��]�3�4�4�8I�#�'�,�8W�8W�W�	�&��V�S�W�\�=�+A���
��s�B'�'B+�.B+r<rc��|jsdS|js|jst�d|��dSt|j��}|j}t�d||j	��|j
�dd��d}	t|||j
��S#t$rt�d|��YdSwxYw)z-Fetch metadata using lazy wheel, if possible.Nz=Lazy wheel is not used as %r does not point to a remote wheelz+Obtaining dependency information from %s %s�#�rz"%s does not support range requests)r�rprqrzr�rrxr�r{�versionrC�splitrr�r)rSr<�wheelr�rCs     r:r�z4RequirementPreparer._fetch_metadata_using_lazy_wheel�s����"�	��4��<�	�t�}�	��L�L�O��
�
�
��4��d�m�$�$���z�����9���M�	
�	
�	
�
�h�n�n�S�!�$�$�Q�'��	�&�t�S�$�-�@�@�@��*�	�	�	��L�L�=�s�C�C�C��4�4�	���s�B)�)%C�CF�partially_downloaded_reqs�Iterable[InstallRequirement]c���tdd���j}i}|D]}|jsJ�|||j<�|j�|���|��}|D]p\}\}}	t�d||��||}||_||j	|jj
<|js"|�t|�����q|D]}|�||���dS)z>Download any requirements which were only fetched by metadata.rFTr_zDownloading link %s to %sN)r)rLr<r��batch�keysrzr��local_file_pathr�rCrq�needs_unpacked_archiver�_prepare_linked_requirement)
rSr�r�rd�links_to_fully_downloadr-�batch_downloadr<�filepath�_s
          r:�_complete_partial_requirementsz2RequirementPreparer._complete_partial_requirements�s&��!�h��F�F�F�K��
CE��,�	4�	4�C��8�O�O�O�03�#�C�H�-�-���-�-�.E�.J�.J�.L�.L�h�W�W��#1�	;�	;��D�-�8�Q��L�L�4�d�H�E�E�E�)�$�/�C�#+�C��.6�D��S�X�\�*��<�
;��*�*�4��>�>�:�:�:��-�	C�	C�C��,�,�S�/�B�B�B�B�	C�	CrIrc�P�|jsJ�|�|��t��5d}|j�D|jjr8|�|��}t
|j|j||j���}|�||j|jj	<ng|�
|��}|�Pd|_|�|��|j
�t|j|j��|_
|cddd��S|�||��cddd��S#1swxYwYdS)z3Prepare a requirement to be obtained from req.link.N)rtT)r<r�r$r[rqr�rbr�r�rCr��needs_more_preparation�set_dist�
download_infor!r�r�)rSr-r�rir\r�s      r:�prepare_linked_requirementz.RequirementPreparer.prepare_linked_requirement�s����x����� � ��%�%�%�
�\�\�$	J�$	J��I�� �

���1B�

��4�4�S�9�9��/��H��%��/2�.E�*E����	��
)�1:�� ����.�.�!%� 9� 9�#� >� >�
� �)�15�C�.��L�L��/�/�/��(��,@��H�c�n�-�-��)�)�C$	J�$	J�$	J�$	J�$	J�$	J�$	J�$	J�H�3�3�C��I�I�I$	J�$	J�$	J�$	J�$	J�$	J�$	J�$	J�$	J�$	J�$	J�$	J����$	J�$	J�$	J�$	J�$	J�$	Js�B?D�9D�D�"D�reqsc��d�|D��}|D]b}|j�Y|jjrM|�|��}t	|j|j|��}|�||j|jj<d|_�cg}|D]5}|jr|�|���|�	||���6|�
||���dS)z,Prepare linked requirements more, if needed.c� �g|]}|j�	|��SrY)r�)�.0r-s  r:�
<listcomp>zHRequirementPreparer.prepare_linked_requirements_more.<locals>.<listcomp>%s ��B�B�B��s�'A�B��B�B�BrINF)r�)r[r<rqr�rbr�rCr��appendr�r�)rSr�r�r-r\rir�s       r:� prepare_linked_requirements_morez4RequirementPreparer.prepare_linked_requirements_more!s��C�B�t�B�B�B���	7�	7�C�� �
7���1B�
7��4�4�S�9�9��/���$�:K�V�T�T�	��7�5>�D�$�S�X�\�2�16�C�.��?A�!��	G�	G�C��)�
G�)�0�0��5�5�5�5��0�0��o�F�F�F�F�	
�+�+�%�+�	,�	
�	
�	
�	
�	
rIc	���|jsJ�|j}|�|��}|r�|jr�|j�J�|jsJ�|jsJ�t
|jjt��r8|jjj	r'|�
|jjj	��rd}n-t�d��|j
|_|j}|�||��|���rd}n�|j|jvrT	t%||j|j|j|j|��}nd#t.$r}t1d|�d|�d|�����d}~wwxYw|j|j}|r|�|��t5|d���}|j��|jrJ�t9||j��|_t
|jjt��rS|jjj	sB|r@t;|j��d���}d|��|jj_ |r|j|_!tE||j#|j$|j%|j&��}	|	S)NzyThe hashes of the source archive found in cache entry don't match, ignoring cached built wheel and re-downloading source.zCould not install requirement z because of HTTP error z	 for URL )rNrzsha256=)'r<r�r�r�rqrpr�r{rr\�
has_one_ofrzr|�cached_wheel_source_linkr�rorCr�rsr�r�r?r[rrrcrK�editabler!r&rL�	hexdigest�hashr�r;r.r/r0r2)
rSr-r�r<r\�
local_file�excrir��dists
          r:r�z/RequirementPreparer._prepare_linked_requirement?s����x�����x���,�,�S�1�1���	 �c�-�	 ��$�0�0�0��=� � � ��<�����3�,�1�;�?�?�
 ��%�*�1�
 ��%�%�c�&7�&<�&C�D�D�
 �������1����
�7����x���%�%�c�?�;�;�;����!�!�	<��J�J�
�X�T�-�
-�	<�

�'���N��N��N��%��
��
�
��*�
�
�
�'�2�S�2�2� �2�2�+/�2�2��������
�����(���2�I��
5��)�)�)�4�4�4��i�d�;�;�;�J���	?��|�#�#�#� 4�T�3�>� J� J�C���3�,�1�;�?�?�
?��)�.�5�
?��
?�
!���1�1�!�4�>�>�@�@��/?��.>�.>��!�&�+��	2�",�/�C��)�����$�� ��!�
�
���s�
(D3�3
E�=E�Ec�F�|j�J�|j�J�|j}|js|���r#|jr|�|j��dS|���rt�d|��dS|j�dStj
�|j|j��}tj
�
|��sFtj|j|��t!|��}t�d|��dSdS)NzENot copying link to destination directory since it is a directory: %szSaved %s)r[r<rnror��archiverzr�r�rvrLrwrxry�shutil�copyr%r{)rSr-r<�download_locationr~s     r:�save_linked_requirementz+RequirementPreparer.save_linked_requirement�s)��� �,�,�,��x�#�#�#��x���;�	�4�/�/�1�1�	�c�l�	��K�K��)�*�*�*��F����!�!�	��L�L�.��
�
�
�

�F���	��F��G�L�L��):�D�M�J�J���w�~�~�/�0�0�	3��K��+�->�?�?�?�(�):�;�;�M��K�K�
�M�2�2�2�2�2�	3�	3rIc��|js
Jd���t�d|��t��5|jrtd|�d����|�|j��|���|j	sJ�t|j��|_t||j|j|j|j��}|�|j��ddd��n#1swxYwY|S)z Prepare an editable requirement.z-cannot prepare a non-editable req as editablezObtaining %szThe editable requirement zT cannot be installed when requiring hashes, because there is no single file to hash.N)r�rzr{r$r�rr�r��update_editabler�r �unpacked_source_directoryr�r;r.r/r0r2�check_if_existsr�)rSr-r�s   r:�prepare_editable_requirementz0RequirementPreparer.prepare_editable_requirement�sV��
�|�L�L�L�L�L�L����N�C�(�(�(�
�\�\�	4�	4��"�
�'���������

�%�%�d�l�3�3�3����!�!�!��>�!�!�!� 7��8U� V� V�C��-���"��(��$��%���D�
���� 2�3�3�3�)	4�	4�	4�	4�	4�	4�	4�	4�	4�	4�	4����	4�	4�	4�	4�,�s�B,C3�3C7�:C7�skip_reasonc�n�|js
Jd���|�Jd|j�����t�d|||jj��t	��5|jrt�d��t|�����cddd��S#1swxYwYdS)z)Prepare an already-installed requirement.z(req should have been satisfied but isn'tNz?did not get skip reason skipped but req.satisfied_by is set to zRequirement %s: %s (%s)z�Since it is already installed, we are trusting this package without checking its hash. To ensure a completely repeatable environment, install into an empty virtualenv.)	�satisfied_byrzr{r�r$r�r�rr)rSr-r�s   r:�prepare_installed_requirementz1RequirementPreparer.prepare_installed_requirement�s7����K�K�!K�K�K�K��	
�	
�
,��)�
,�
,�	
�	
�	
�	���%�{�C��9I�9Q�	
�	
�	
��\�\�	J�	J��"�
����(����)��-�-�G�G�I�I�	J�	J�	J�	J�	J�	J�	J�	J�	J�	J�	J�	J����	J�	J�	J�	J�	J�	Js�AB*�*B.�1B.)"r�r>r[rMr�r>r0r1r�r	r2r1r.rr�rr�r,r�rr�r1r�r1r�r1r?r@r�r1r�r@r3rA)r-rr3rA)r-rr�r1r3rA)r-rr3r")r-rr3r�)r<rr3r�)F)r�r�r�r1r3rA)r-rr�r1r3r)r�r�r�r1r3rA)r-rr3r)r-rr�r>r3r)rUrVrW�__doc__r�r�r�r�r�r�r�r�r�r�r�r�r�r��
__classcell__)r�s@r:r�r��s�������� � �;5�;5�;5�;5�;5�;5�zB�B�B�B�6.�.�.�.�.C�C�C�C�@=�=�=�=�&'�'�'�'�R����@!&�'C�'C�'C�'C�'C�T@E�*J�*J�*J�*J�*J�ZKP�
�
�
�
�
�<Z�Z�Z�Z�x3�3�3�3�4����BJ�J�J�J�J�J�J�JrIr�)r-rr.rr/r	r0r1r2r1r3r)r<rr=r>r?r@r3rA)NN)
r<rrZrr[rMr\r]r3rK)r<rr[rMr\r]r3rK)r<rr=r>rZrr?r@r[rMr\r]r3rk)T)
r<rr[r>r\r]rtr1r3rM)Ur��
__future__rrPrvr��collections.abcr�dataclassesr�pathlibr�typingr�pip._vendor.packaging.utilsr�pip._internal.build_envr	�pip._internal.distributionsr
�%pip._internal.distributions.installedr�pip._internal.exceptionsrr
rrrrr�"pip._internal.index.package_finderr�pip._internal.metadatarr�pip._internal.models.direct_urlr�pip._internal.models.linkr�pip._internal.models.wheelr�pip._internal.network.downloadr� pip._internal.network.lazy_wheelrr�pip._internal.network.sessionr�,pip._internal.operations.build.build_trackerr�pip._internal.req.req_installr�pip._internal.utils._logr�&pip._internal.utils.direct_url_helpersr r!�pip._internal.utils.hashesr"r#�pip._internal.utils.loggingr$�pip._internal.utils.miscr%r&r'r(�pip._internal.utils.temp_dirr)�pip._internal.utils.unpackingr*�pip._internal.vcsr+�pip._internal.cli.progress_barsr,rUrzr;rHrKrgrjrsrbr�rYrIr:�<module>rs%��.�.�#�"�"�"�"�"�����	�	�	�	�
�
�
�
�$�$�$�$�$�$�!�!�!�!�!�!������� � � � � � �9�9�9�9�9�9�=�=�=�=�=�=�Q�Q�Q�Q�Q�Q�G�G�G�G�G�G�������������������=�<�<�<�<�<�N�N�N�N�N�N�N�N�7�7�7�7�7�7�*�*�*�*�*�*�,�,�,�,�,�,�5�5�5�5�5�5���������5�4�4�4�4�4�E�E�E�E�E�E�<�<�<�<�<�<�.�.�.�.�.�.���������=�<�<�<�<�<�<�<�2�2�2�2�2�2�������������7�6�6�6�6�6�5�5�5�5�5�5�!�!�!�!�!�!��8�7�7�7�7�7�7�	��8�	�	��5�5�5�5�$N�N�N�N������������" $� �	)�)�)�)�)�2JN�!�!�!�!�!�: $� �
(�(�(�(�(�^#'�	�����<KJ�KJ�KJ�KJ�KJ�KJ�KJ�KJ�KJ�KJrI