403Webshell
Server IP : 127.0.0.1  /  Your IP : 216.73.216.109
Web Server : Apache/2.4.54 (Win64) OpenSSL/1.1.1q PHP/8.1.10
System : Windows NT DESKTOP-E5T4RUN 10.0 build 19045 (Windows 10) AMD64
User : SERVERWEB ( 0)
PHP Version : 8.1.10
Disable Function : NONE
MySQL : OFF |  cURL : ON |  WGET : OFF |  Perl : OFF |  Python : OFF |  Sudo : OFF |  Pkexec : OFF
Directory :  C:/cygwin64/lib/python3.9/site-packages/pip/_internal/operations/__pycache__/

Upload File :
current_dir [ Writeable] document_root [ Writeable]

 

Command :


[ Back ]     

Current File : C:/cygwin64/lib/python3.9/site-packages/pip/_internal/operations/__pycache__/prepare.cpython-39.pyc
a

X��e�m�	@sZdZddlZddlZddlZddlmZddlmZmZm	Z	m
Z
ddlmZddl
mZddlmZddlmZmZmZmZmZmZmZdd	lmZdd
lmZmZddlmZddl m!Z!dd
l"m#Z#ddl$m%Z%m&Z&ddl'm(Z(m)Z)ddl*m+Z+ddl,m-Z-ddl.m/Z/ddl0m1Z1ddl2m3Z3m4Z4ddl5m6Z6m7Z7ddl8m9Z9ddl:m;Z;m<Z<m=Z=m>Z>ddl?m@Z@ddlAmBZBddlCmDZDe1eE�ZFe/e-eeGeGed�dd�ZHe!eIeJdd�dd �ZKGd!d"�d"�ZLd2e!e&e
eIe
e6eLd#�d$d%�ZMd3e!e
eIe
e6eLd&�d'd(�ZNd4e!eIe&eJe
eIe
e6e
eLd)�d*d+�ZOd5e!eIe
e6eGe
eId-�d.d/�ZPGd0d1�d1�ZQdS)6z)Prepares a distribution for installation
�N)�Path)�Dict�Iterable�List�Optional)�canonicalize_name)�)make_distribution_for_install_requirement)�InstalledDistribution)�DirectoryUrlHashUnsupported�HashMismatch�HashUnpinned�InstallationError�MetadataInconsistent�NetworkConnectionError�VcsHashUnsupported)�
PackageFinder)�BaseDistribution�get_metadata_distribution)�ArchiveInfo)�Link)�Wheel)�BatchDownloader�
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)�req�
build_tracker�finder�build_isolation�check_build_deps�returncCsXt|�}|j}|durP|�||��|�|||�Wd�n1sF0Y|��S)z(Prepare a distribution for installation.N)rZbuild_tracker_idZtrackZprepare_distribution_metadatar)r+r,r-r.r/Z
abstract_distZ
tracker_id�r1�D/usr/lib/python3.9/site-packages/pip/_internal/operations/prepare.py�_get_prepared_distribution;s�"r3)�link�location�	verbosityr0cCs2t�|j�}|dusJ�|j|t|j�|d�dS)N)�urlr6)r*Zget_backend_for_scheme�scheme�unpackr&r7)r4r5r6Zvcs_backendr1r1r2�unpack_vcs_linkMsr:c@s"eZdZeeedd�dd�ZdS)�FileN)�path�content_typer0cCs*||_|dur t�|�d|_n||_dS)Nr)r<�	mimetypesZ
guess_typer=)�selfr<r=r1r1r2�__init__Tsz
File.__init__)�__name__�
__module__�__qualname__�strrr@r1r1r1r2r;Ssr;)r4�download�download_dir�hashesr0cCsVtddd�}d}|r t|||�}|r.|}d}n|||j�\}}|rL|�|�t||�S)Nr9T��kindZglobally_managed)r(�_check_download_dirr<�check_against_pathr;)r4rErFrG�temp_dir�already_downloaded_path�	from_pathr=r1r1r2�get_http_url\s
rO)r4rFrGr0cCs<d}|rt|||�}|r|}n|j}|r2|�|�t|d�S)z'Get file and optionally check its hash.N)rJ�	file_pathrKr;)r4rFrGrMrNr1r1r2�get_file_urlts
rQ)r4r5rEr6rFrGr0cCsd|jrt|||d�dS|��r$J�|jr:t|||d�}nt||||d�}|js`t|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.
    )r6N�rG)
�is_vcsr:�is_existing_dir�is_filerQrO�is_wheelr)r<r=)r4r5rEr6rFrG�filer1r1r2�
unpack_url�s�	rXT)r4rFrG�warn_on_hash_mismatchr0cCsrtj�||j�}tj�|�s dSt�d|�|rnz|�|�Wn.tyl|r\t�	d|�t�
|�YdS0|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.)�osr<�join�filename�exists�logger�inforKr�warning�unlink)r4rFrGrY�
download_pathr1r1r2rJ�s 	�
rJcs<eZdZdZeeeeeeeeee	eeee
edd��fdd�Zedd�dd�Z
eedd	�d
d�Zeed�dd
�Zeeed�dd�Zeeed�dd�Zeeed�dd�Zd'eeedd�dd�Zd(eeed	�dd�Zd)eeedd�dd�Zeeed	�dd�Zedd�d d!�Zeed�d"d#�Zeeed$�d%d&�Z�ZS)*�RequirementPreparerzPrepares a RequirementN)�	build_dirrF�src_dirr.r/r,�session�progress_barr-�require_hashes�
use_user_site�
lazy_wheelr6�legacy_resolverr0cs�t���||_||_||_||_t||�|_t||�|_	|	|_
||_||_||_
|
|_||_||_|
|_||_i|_d|_dS)N)�rl)�superr@rerdr,�_sessionr�	_downloadr�_batch_downloadr-rFr.r/rhri�use_lazy_wheelr6rk�_downloaded�_previous_requirement_header)r?rdrFrer.r/r,rfrgr-rhrirjr6rk��	__class__r1r2r@�s$
zRequirementPreparer.__init__)r+r0cCs�|jjr$|js$d}tt|jj��}nd}|jr8t|j�nt|�}|jr~|jr~t	|jt�r`|j}n
|j�
�}|r~|d|�d�7}||f|jkr�||f|_t�
||�|jr�t�� t�
d|jj�Wd�n1s�0YdS)z3Provide context for the requirement being prepared.z
Processing %sz
Collecting %sz (from �)zUsing cached %sN)r4rU�is_wheel_from_cacherDr$rPr+r'�
comes_from�
isinstancerNrsr^r_r#r\)r?r+�messageZinformationrxr1r1r2�_log_preparing_links"

z'RequirementPreparer._log_preparing_link)r+�parallel_buildsr0cCsP|jjrdS|jdusJ�|j��r2|jj|_dS|j|jd|d�|��dS)z1Ensure source_dir of a linked InstallRequirement.NT)Z
autodeleter|)r4rV�
source_dirrTrP�ensure_has_source_dirrdZensure_pristine_source_checkout)r?r+r|r1r1r2�_ensure_link_req_src_dir-s

�z,RequirementPreparer._ensure_link_req_src_dircCsT|js|jdd�S|jjr t��|j��r0t��|jsB|jsBt	��|jdd�pRt
�S)NT)Ztrust_internetF)rhrGr4rSrrTr
Z	is_directZ	is_pinnedrr"�r?r+r1r1r2�_get_linked_req_hashesDs
z*RequirementPreparer._get_linked_req_hashescCs>|jrt�d�dS|jr(t�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)rkr^�debugrh�$_fetch_metadata_using_link_data_attr� _fetch_metadata_using_lazy_wheelr4r�r1r1r2�_fetch_metadata_onlyds���
�z(RequirementPreparer._fetch_metadata_onlycCs�|j��}|durdS|jdus$J�t�d|j|�t||j|��d�}t|j	d��}|�
�}Wd�n1sr0Yt||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 %srR�rb�Name)r4�
metadata_linkr+r^�verboserOroZ	as_hashes�openr<�readrr\�namerZraw_namer)r?r+r�Z
metadata_file�fZmetadata_contents�
metadata_distr1r1r2r�ws4
��&��z8RequirementPreparer._fetch_metadata_using_link_data_attr)r4r0cCs�|js
dS|js|js&t�d|�dSt|j�}t|j�}t�	d||j
�|j�dd�d}zt
|||j�WSty�t�d|�YdS0dS)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)rqrUrVr^r�rr\rr�r_�versionr7�splitrrnr)r?r4Zwheelr�r7r1r1r2r��s*�

�z4RequirementPreparer._fetch_metadata_using_lazy_wheelF)�partially_downloaded_reqsr|r0c
Cs�tddd�j}i}|D]}|js$J�|||j<q|�|��|�}|D]J\}\}}	t�d||�||}||_||j|jj	<|j
sD|�t|��qD|D]}|�
||�q�dS)z>Download any requirements which were only fetched by metadata.r9TrHzDownloading link %s to %sN)r(r<r4rp�keysr^r��local_file_pathrrr7rVZneeds_unpacked_archiver�_prepare_linked_requirement)
r?r�r|rLZlinks_to_fully_downloadr+Zbatch_downloadr4�filepath�_r1r1r2�_complete_partial_requirements�s$
�z2RequirementPreparer._complete_partial_requirementscCs�|js
J�|�|�t���d}|jdurT|jjrT|�|�}t|j|j||jd�}|durl||j|jj	<n*|�
|�}|dur�d|_|Wd�S|�||�Wd�S1s�0YdS)z3Prepare a requirement to be obtained from req.link.N)rYT)
r4r{r#rFrVr�rJrwrrr7r��needs_more_preparationr�)r?r+r|rPrGr�r1r1r2�prepare_linked_requirement�s&


�

z.RequirementPreparer.prepare_linked_requirement)�reqsr|r0cCs�dd�|D�}|D]L}|jdur|jjr|�|�}t|j|j|�}|dur||j|jj<d|_qg}|D]"}|jr~|�|�qh|�	||�qh|j
||d�dS)z,Prepare linked requirements more, if needed.cSsg|]}|jr|�qSr1)r�)�.0r+r1r1r2�
<listcomp>�zHRequirementPreparer.prepare_linked_requirements_more.<locals>.<listcomp>NF)r|)rFr4rVr�rJrrr7r��appendr�r�)r?r�r|r+rGrPr�r1r1r2� prepare_linked_requirements_mores"
�z4RequirementPreparer.prepare_linked_requirements_morec

Cs�|js
J�|j}|�|�}|r�|jr�|jdus2J�|js<J�|jsFJ�t|jjt�rt|jjj	rt|�
|jjj	�rtd}nt�d�|j
|_|j}|�||�|��r�d}n�|j|jv�rzt||j|j|j|j|�}Wn@t�y}z&td|�d|�d|����WYd}~n
d}~00n(|j|j}|�r2|�|�t|dd�}|jdu�r�|j�rVJ�t||j�|_t|jjt��r�|jjj	�s�|�r�t|j�d��}d|��|jj_ |�r�|j|_!t"||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 )r=rzsha256=)'r4r�rw�
download_inforVrUryr_rrGZ
has_one_ofr^r`Zcached_wheel_source_linkrrTr7rrrXr}ror6rFrr
rKr;�editabler r%r<Z	hexdigest�hashr�r3r,r-r.r/)
r?r+r|r4rGZ
local_file�excrPr��distr1r1r2r�-s�




���	�����
����z/RequirementPreparer._prepare_linked_requirementcCs�|jdusJ�|jdusJ�|j}|js6|��rF|jrF|�|j�dS|��r^t�d|�dS|jdurldSt	j
�|j|j�}t	j
�
|�s�t�|j|�t|�}t�d|�dS)NzENot copying link to destination directory since it is a directory: %szSaved %s)rFr4rSrTr��archiver^r�r�rZr<r[r\r]�shutil�copyr$r_)r?r+r4Zdownload_locationrbr1r1r2�save_linked_requirement�s&�
z+RequirementPreparer.save_linked_requirementcCs�|jsJd��t�d|�t��t|jr8td|�d���|�|j�|��|j	sVJ�t
|j�|_t
||j|j|j|j�}|�|j�Wd�n1s�0Y|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�r^r_r#rhr
r~reZupdate_editabler}rZunpacked_source_directoryr�r3r,r-r.r/Zcheck_if_existsri)r?r+r�r1r1r2�prepare_editable_requirement�s(
�
�*z0RequirementPreparer.prepare_editable_requirement)r+�skip_reasonr0cCs�|jsJd��|dus&Jd|j����t�d|||jj�t��,|jrRt�d�t|���Wd�S1sr0YdS)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.)	Zsatisfied_byr^r_r�r#rhr�r	r)r?r+r�r1r1r2�prepare_installed_requirement�s
����z1RequirementPreparer.prepare_installed_requirement)F)F)F)rArBrC�__doc__rDr�boolrrr�intr@rr{rr!r�rr�r�rr�rr�r�r�r�r�r�r��
__classcell__r1r1rtr2rc�st�:�"��+� ��-��'���\�#�rc)NN)NN)NN)T)Rr�r>rZr��pathlibr�typingrrrrZpip._vendor.packaging.utilsrZpip._internal.distributionsrZ%pip._internal.distributions.installedr	Zpip._internal.exceptionsr
rrr
rrrZ"pip._internal.index.package_finderrZpip._internal.metadatarrZpip._internal.models.direct_urlrZpip._internal.models.linkrZpip._internal.models.wheelrZpip._internal.network.downloadrrZ pip._internal.network.lazy_wheelrrZpip._internal.network.sessionrZ,pip._internal.operations.build.build_trackerrZpip._internal.req.req_installrZpip._internal.utils._logrZ&pip._internal.utils.direct_url_helpersrr Zpip._internal.utils.hashesr!r"Zpip._internal.utils.loggingr#Zpip._internal.utils.miscr$r%r&r'Zpip._internal.utils.temp_dirr(Zpip._internal.utils.unpackingr)Zpip._internal.vcsr*rAr^r�r3rDr�r:r;rOrQrXrJrcr1r1r1r2�<module>s�$	�������/��

Youez - 2016 - github.com/yon3zu
LinuXploit