<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0-alpha1/dist/css/bootstrap.min.css" rel="stylesheet"
        integrity="sha384-GLhlTQ8iRABdZLl6O3oVMWSktQOp6b7In1Zl3/Jr59b6EGGoI1aFkw7cmDA6j6gD" crossorigin="anonymous">
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.3.0/css/all.min.css"
        integrity="sha512-SzlrxWUlpfuzQ+pcUCosxcglQRNAq/DZjVsC0lE40xsADsfeQoEypE+enwcOiGjk/bSuGGKHEyjSoQ1zVisanQ=="
        crossorigin="anonymous" referrerpolicy="no-referrer" />
</head>
</html>
U
    .e,                     @   s  d Z ddlZddlZddlmZ ddlmZ ddlmZ ddl	m
Z
 ddlmZmZmZmZmZ ddlmZ dd	lmZ dd
lmZ ddlmZ ddlmZmZ ddlmZ erddlmZ ddlm Z  ddl!m"Z" ddl#m$Z$ ddl%m&Z& ddl'm(Z( e)e*Z+dd Z,G dd de-Z.dS )z)Prepares a distribution for installation
    N)requests))make_distribution_for_install_requirement)InstalledDistribution)
unpack_url)DirectoryUrlHashUnsupportedHashUnpinnedInstallationErrorPreviousBuildDirErrorVcsHashUnsupported)
expanduser)MissingHashes)
indent_log)write_delete_marker_file)display_pathnormalize_path)MYPY_CHECK_RUNNING)Optional)AbstractDistribution)PackageFinder)
PipSession)InstallRequirement)RequirementTrackerc              	   C   s.   t | }||  ||| W 5 Q R X |S )z-Prepare a distribution for installation.
    )r   ZtrackZprepare_distribution_metadata)reqreq_trackerfinderbuild_isolationabstract_dist r   D/usr/lib/python3.8/site-packages/pip/_internal/operations/prepare.py_get_prepared_distribution,   s    r   c                       sD   e Zd ZdZ fddZedd Zdd Zdd	 Zd
d Z	  Z
S )RequirementPreparerzPrepares a Requirement
    c                    sT   t t|   || _|| _|| _|r,t|}|| _|r>t|}|| _	|| _
|| _d S )N)superr    __init__src_dir	build_dirr   r   download_dirr   wheel_download_dirprogress_barr   )selfr$   r%   r#   r&   r'   r   r   	__class__r   r   r"   9   s    zRequirementPreparer.__init__c                 C   s<   | j s
dS tj| j rdS td tdt| j  d S )NFTz!Could not find download directoryz0Could not find or access download directory '%s')r%   ospathexistsloggercriticalr   r   )r(   r   r   r   _download_should_savea   s    
z)RequirementPreparer._download_should_savec                 C   s  |j }|jdkr(|j}tdt| ntd|jp6| t b || j	 t
jt
j|jdrztd||jf |r|jrt n| rt |js|jst |j| d}|r|st }| j}|jr| jr| j}zt||j|||| jd W nF tjk
rB }	 z$t d||	 t!d	||	|f W 5 d
}	~	X Y nX |jr^|rXd}
nd}
nd}
|
rrt"|j t#|| j$|| j%}| j&r|jr|'| j W 5 Q R X |S )zCPrepare a requirement that would be obtained from req.link
        filezProcessing %szCollecting %szsetup.pyzpip can't proceed with requirements '%s' due to a pre-existing build directory (%s). This is likely due to a previous installation that failed. pip is being responsible and not assuming it can delete this. Please delete it and try again.)Ztrust_internet)sessionhashesr'   z4Could not install requirement %s because of error %szDCould not install requirement %s because of HTTP error %s for URL %sNTF)(linkZschemeZ	file_pathr.   infor   r   r   ensure_has_source_dirr$   r+   r,   r-   joinZ
source_dirr	   Zis_vcsr
   Zis_existing_dirr   Zoriginal_linkZ	is_pinnedr   r3   r   r%   Zis_wheelr&   r   r'   r   Z	HTTPErrorr/   r   r   r   r   r   r0   archive)r(   r   r2   r   require_hashesr4   r,   r3   r%   excZautodelete_unpackedr   r   r   r   prepare_linked_requiremento   s~    

   

   z.RequirementPreparer.prepare_linked_requirementc              	   C   sz   t d| t ^ |r$td| || j || j  t|| j	|| j
}| jrb|| j || W 5 Q R X |S )z(Prepare an editable requirement
        zObtaining %szoThe editable requirement %s cannot be installed when requiring hashes, because there is no single file to hash.)r.   r5   r   r   r6   r#   Zupdate_editabler0   r   r   r   r8   r%   Zcheck_if_exists)r(   r   r9   Zuse_user_siter   r   r   r   r   prepare_editable_requirement   s(       z0RequirementPreparer.prepare_editable_requirementc              	   C   s@   t d|||jj t  |r*t d t|}W 5 Q R X |S )z1Prepare an already-installed requirement
        zRequirement %s: %s (%s)zSince it is already installed, we are trusting this package without checking its hash. To ensure a completely repeatable environment, install into an empty virtualenv.)r.   r5   Zsatisfied_byversionr   debugr   )r(   r   r9   Zskip_reasonr   r   r   r   prepare_installed_requirement  s      z1RequirementPreparer.prepare_installed_requirement)__name__
__module____qualname____doc__r"   propertyr0   r;   r<   r?   __classcell__r   r   r)   r   r    5   s   (
z"r    )/rC   Zloggingr+   Zpip._vendorr   Zpip._internal.distributionsr   Z%pip._internal.distributions.installedr   Zpip._internal.downloadr   Zpip._internal.exceptionsr   r   r   r	   r
   Zpip._internal.utils.compatr   Zpip._internal.utils.hashesr   Zpip._internal.utils.loggingr   Z pip._internal.utils.marker_filesr   Zpip._internal.utils.miscr   r   Zpip._internal.utils.typingr   typingr   r   Zpip._internal.indexr   Zpip._internal.network.sessionr   Zpip._internal.req.req_installr   Zpip._internal.req.req_trackerr   Z	getLoggerr@   r.   r   objectr    r   r   r   r   <module>   s.   
	