<!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>
B
    Re;                 @   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 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 ddlmZ ddl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& e&rZddl'm(Z( ddl)m*Z*m+Z+m,Z,m-Z- ddl.m/Z/ ddl0m1Z1 ddl2m3Z3 ddl4m5Z5 ddl6m7Z7 ddl#m8Z8m9Z9 e:e;Z<G dd de
Z=G dd dee=Z>e$j?e$j@e$jAgZBdd  ZCG d!d" d"e>ZDdS )#a  Contains the Command base classes that depend on PipSession.

The classes in this module are in a separate module so the commands not
needing download / PackageFinder capability don't unnecessarily import the
PackageFinder machinery and all its vendored dependencies, etc.
    N)partial)
cmdoptions)Command)CommandContextMixIn)CommandErrorPreviousBuildDirError)LinkCollector)PackageFinder)SelectionPreferences)
Downloader)
PipSession)RequirementPreparer)install_req_from_editableinstall_req_from_line#install_req_from_parsed_requirementinstall_req_from_req_string)parse_requirements)pip_self_version_check)tempdir_kinds)MYPY_CHECK_RUNNING)Values)AnyListOptionalTuple)
WheelCache)TargetPython)InstallRequirement)RequirementTracker)BaseResolver)TempDirectoryTempDirectoryTypeRegistryc                   s>   e Zd ZdZ fddZedd Zdd Zdd	d
Z  Z	S )SessionCommandMixinzE
    A class mixin for command classes needing _build_session().
    c                s   t t|   d | _d S )N)superr"   __init___session)self)	__class__ /builddir/build/BUILDROOT/alt-python37-pip-20.2.4-6.el8.x86_64/opt/alt/python37/lib/python3.7/site-packages/pip/_internal/cli/req_command.pyr$   8   s    zSessionCommandMixin.__init__c             C   sL   g }t |dds*t |dd}|r*|| t |dd}|rD|| |pJdS )z7Return a list of index urls from user-provided options.no_indexF	index_urlNextra_index_urls)getattrappendextend)clsoptions
index_urlsurlurlsr(   r(   r)   _get_index_urls=   s    

z#SessionCommandMixin._get_index_urlsc             C   s0   | j dkr*| | || _ | j dk	s*t| j S )zGet a default-managed session.N)r%   enter_context_build_sessionAssertionError)r&   r1   r(   r(   r)   get_default_sessionL   s    
z'SessionCommandMixin.get_default_sessionNc             C   s   |j rtj|j stt|j r0tj|j dnd |d k	r>|n|j|j| 	|d}|j
rb|j
|_|jrp|j|_
|jsz|r|d k	r|n|j|_|jr|j|jd|_|j |j_|S )Nhttp)cacheretriestrusted_hostsr2   )r:   https)	cache_dirospathisabsr8   r   joinr<   r=   r5   certverifyclient_certtimeoutproxyproxiesno_inputauth	prompting)r&   r1   r<   rG   sessionr(   r(   r)   r7   W   s"    
z"SessionCommandMixin._build_session)NN)
__name__
__module____qualname____doc__r$   classmethodr5   r9   r7   __classcell__r(   r(   )r'   r)   r"   3   s
   r"   c               @   s   e Zd ZdZdd ZdS )IndexGroupCommandz
    Abstract base class for commands with the index_group options.

    This also corresponds to the commands that permit the pip version check.
    c          	   C   sT   t |dst|js|jrdS | j|dtd|jd}| t|| W dQ R X dS )z
        Do the pip version check if not disabled.

        This overrides the default behavior of not doing the check.
        r*   Nr      )r<   rG   )hasattrr8   disable_pip_version_checkr*   r7   minrG   r   )r&   r1   rM   r(   r(   r)   handle_pip_version_check   s    z*IndexGroupCommand.handle_pip_version_checkN)rN   rO   rP   rQ   rY   r(   r(   r(   r)   rT      s   rT   c                s   dd   fdd}|S )zNDecorator for common logic related to managing temporary
    directories.
    c             S   s   xt D ]}| |d qW d S )NF)KEEPABLE_TEMPDIR_TYPES
set_delete)registrytr(   r(   r)   configure_tempdir_registry   s    
z0with_cleanup.<locals>.configure_tempdir_registryc                sP   | j d k	st|jr | j  y| ||S  tk
rJ    | j   Y nX d S )N)tempdir_registryr8   no_cleanr   )r&   r1   args)r^   funcr(   r)   wrapper   s    

zwith_cleanup.<locals>.wrapperr(   )rb   rc   r(   )r^   rb   r)   with_cleanup   s    rd   c            	       sV   e Zd Z fddZedddZedd	d
Zdd Zedd ZdddZ	  Z
S )RequirementCommandc                s&   t t| j|| | jt  d S )N)r#   re   r$   cmd_opts
add_optionr   r`   )r&   ra   kw)r'   r(   r)   r$      s    zRequirementCommand.__init__Nc       
      C   sB   t ||jd}| j}	|	dk	s tt|	|j|||j||||j|d
S )zQ
        Create a RequirementPreparer instance for the given parameters.
        )progress_barN)
	build_dirsrc_dirdownload_dirwheel_download_dirbuild_isolationreq_tracker
downloaderfinderrequire_hashesuse_user_site)r   ri   rA   r8   r   rk   rn   rr   )
temp_build_dirr1   ro   rM   rq   rs   rl   rm   rp   temp_build_dir_pathr(   r(   r)   make_requirement_preparer   s    z,RequirementCommand.make_requirement_preparerFTto-satisfy-onlyc             C   s   t t|j|	d}d|jkrTddl}|jjjjj	| |||||j
|||||
d|jkdS ddl}|jjjjj	| |||||j
|||||
dS )zF
        Create a Resolver instance for the given parameters.
        )isolated
use_pep517z2020-resolverr   Nz	fast-deps)preparerrq   wheel_cachemake_install_reqrs   ignore_dependenciesignore_installedignore_requires_pythonforce_reinstallupgrade_strategypy_version_info
lazy_wheel)rz   rq   r{   r|   rs   r}   r~   r   r   r   r   )r   r   isolated_modefeatures_enabled,pip._internal.resolution.resolvelib.resolver	_internal
resolution
resolvelibresolverResolverr}   (pip._internal.resolution.legacy.resolverlegacy)rz   rq   r1   r{   rs   r~   r   r   r   ry   r   r|   pipr(   r(   r)   make_resolver   s@    
z RequirementCommand.make_resolverc             C   sf  g }xD|j D ]:}x4t|d|||dD ]}t||jdd}|| q$W qW x,|D ]$}	t|	d|j|jdd}|| qPW x,|jD ]"}	t|	d|j|jd}|| qW xF|j	D ]<}x6t||||dD ]"}t||j|jdd}|| qW qW t
d	d
 |D rd|_|sb|jsb|j	sbd| ji}
|jrRtdjf t|
d|jdntdjf |
|S )zS
        Parse command-line arguments into the corresponding requirements.
        T)
constraintrq   r1   rM   F)rx   user_suppliedN)rx   ry   r   )r   rx   ry   )rq   r1   rM   c             s   s   | ]}|j V  qd S )N)has_hash_options).0reqr(   r(   r)   	<genexpr>Z  s    z6RequirementCommand.get_requirements.<locals>.<genexpr>namezXYou must give at least one requirement to {name} (maybe you meant "pip {name} {links}"?) )linkszHYou must give at least one requirement to {name} (see "pip help {name}"))constraintsr   r   r   r.   r   ry   	editablesr   requirementsanyrr   r   
find_linksr   formatdictrC   )r&   ra   r1   rq   rM   r   filename
parsed_req
req_to_addr   optsr(   r(   r)   get_requirements#  s\    


z#RequirementCommand.get_requirementsc             C   s    | j }| }|rt| dS )zE
        Trace basic information about the provided objects.
        N)search_scopeget_formatted_locationsloggerinfo)rq   r   	locationsr(   r(   r)   trace_basic_infok  s    z#RequirementCommand.trace_basic_infoc             C   s6   t j||d}td|j|j|j|d}tj|||dS )z
        Create a package finder appropriate to this requirement command.

        :param ignore_requires_python: Whether to ignore incompatible
            "Requires-Python" values in links. Defaults to False.
        )r1   T)allow_yankedformat_controlallow_all_prereleasesprefer_binaryr   )link_collectorselection_prefstarget_python)r   creater
   r   prer   r	   )r&   r1   rM   r   r   r   r   r(   r(   r)   _build_package_finderw  s    z(RequirementCommand._build_package_finder)NN)NFTFFrw   NN)NN)rN   rO   rP   r$   staticmethodrv   r   r   r   r   rS   r(   r(   )r'   r)   re      s"           -H re   )ErQ   loggingr@   	functoolsr   Zpip._internal.clir   pip._internal.cli.base_commandr   !pip._internal.cli.command_contextr   pip._internal.exceptionsr   r   pip._internal.index.collectorr   "pip._internal.index.package_finderr	   $pip._internal.models.selection_prefsr
   pip._internal.network.downloadr   pip._internal.network.sessionr    pip._internal.operations.preparer   pip._internal.req.constructorsr   r   r   r   Zpip._internal.req.req_filer   !pip._internal.self_outdated_checkr   pip._internal.utils.temp_dirr   pip._internal.utils.typingr   optparser   typingr   r   r   r   pip._internal.cacher   "pip._internal.models.target_pythonr   Zpip._internal.req.req_installr   pip._internal.req.req_trackerr   pip._internal.resolution.baser   r    r!   	getLoggerrN   r   r"   rT   	BUILD_ENVEPHEM_WHEEL_CACHE	REQ_BUILDrZ   rd   re   r(   r(   r(   r)   <module>   sF   
L 