JFIF$        dd7 

Viewing File: /usr/lib/python3.9/site-packages/pip/_internal/req/__pycache__/req_install.cpython-39.opt-1.pyc

a

[��fJ��@s@ddlZddlZddlZddlZddlZddlZddlZddlmZm	Z	m
Z
mZmZm
Z
mZmZddlmZddlmZddlmZddlmZddlmZddlmZdd	lmZdd
lmZddl m!Z!ddl"m#Z#m$Z$dd
l%m&Z&ddl'm(Z(ddl)m*Z*ddl+m,Z,ddl-m.Z.ddl/m,Z0ddl1m2Z3ddl4m5Z5ddl4m6Z7ddl8m9Z9ddl:m;Z;m<Z<ddl=m>Z>ddl?m@Z@ddlAmBZBmCZCddlDmEZEddlFmGZGmHZHmIZImJZJmKZKmLZLmMZMmNZNmOZOddlPmQZQddlRmSZSddlTmUZUmVZVddlWmXZXdd lYmZZZe�[e\�Z]e^e!d!�d"d#�Z_Gd$d%�d%�Z`e`e^d&�d'd(�ZadS))�N)�Any�
Collection�Dict�Iterable�List�Optional�Sequence�Union)�
pkg_resources)�Marker)�Requirement)�SpecifierSet)�canonicalize_name)�Version)�parse)�Pep517HookCaller)�Distribution)�BuildEnvironment�NoOpBuildEnvironment)�InstallationError)�
get_scheme)�Link)�generate_metadata)�generate_editable_metadata)�install_editable)�LegacyInstallFailure)�install)�
install_wheel)�load_pyproject_toml�make_pyproject_path)�UninstallPathSet)�
deprecated)�direct_url_for_editable�direct_url_from_link)�Hashes)	�ask_path_exists�
backup_dir�display_path�dist_in_install_path�dist_in_site_packages�dist_in_usersite�get_distribution�hide_url�redact_auth_from_url)�get_metadata)�runner_with_spinner_message)�
TempDirectory�
tempdir_kinds)�running_under_virtualenv)�vcs)�metadata_directory�returncCsx|�tj�}tj�|�\}}t�||�}|�d�rJtj}tj�	|�d}n tj
}tj�	|�d�d�d}||||d�S)zQReturn a pkg_resources.Distribution for the provided
    metadata directory.
    z	.egg-infor�-)�project_name�metadata)�rstrip�os�sep�path�splitr
ZPathMetadata�endswithr�splitextZDistInfoDistribution)r4Zdist_dir�base_dirZ
dist_dir_namer8Zdist_clsZ	dist_name�rA�A/usr/lib/python3.9/site-packages/pip/_internal/req/req_install.py�	_get_distBs
�rCc@s�eZdZdZdSeeeeedfeee	ee
eeeeeeeeeeeeeefee
eeedd�dd�Zed�d	d
�Zed�dd�Zed�d
d�Zeeed�dd��Ze��ed�dd��Zeed�dd��Zeed�dd��ZdTeeeed�dd�Zeed�dd��ZdUeed�dd�Zeed�d d!�Zeeeed"�d#d$�Z dd�d%d&�Z!dd�d'd(�Z"edd)�d*d+�Z#eed�d,d-��Z$eed�d.d/��Z%eed�d0d1��Z&eed�d2d3��Z'eed�d4d5��Z(dd�d6d7�Z)dd�d8d9�Z*dd�d:d;�Z+ee,d�d<d=��Z-e.d�d>d?�Z/dd�d@dA�Z0dVeeeddB�dCdD�Z1dd�dEdF�Z2dWeeee3dG�dHdI�Z4eeeedJ�dKdL�Z5eeddM�dNdO�Z6dXeeee7eeeeeeeeeeddP�	dQdR�Z8dS)Y�InstallRequirementz�
    Represents something that may be installed later on, may have information
    about where to fetch the relevant requirement and also contains logic for
    installing the said requirement.
    FNrA)�req�
comes_from�editable�link�markers�
use_pep517�isolated�install_options�global_options�hash_options�
constraint�extras�
user_supplied�permit_editable_wheelsr5cCsf||_||_||_||_||_d|_d|_|jrN|jrNtj	�
tj	�|j��|_|durj|rj|j
rjt|j
�}||_|_d|_d|_|jr�|jjr�|jj|_|r�||_n |r�dd�|jD�|_nt�|_|dur�|r�|j}||_d|_d|_d|_d|_|r�|ng|_|	�r|	ng|_|
�r|
ni|_d|_|
|_||_ t!�|_"d|_#d|_$g|_%d|_&||_'d|_(dS)NFcSsh|]}t�|��qSrA)r
Z
safe_extra��.0�extrarArArB�	<setcomp>��z.InstallRequirement.__init__.<locals>.<setcomp>))rErFrOrGrR�legacy_install_reason�
source_dir�is_filer:r<�normpath�abspathZ	file_path�urlrrH�
original_link�original_link_is_in_wheel_cache�local_file_pathrP�setZmarkerrI�satisfied_by�should_reinstall�_temp_build_dir�install_succeededrLrMrNZpreparedrQrKr�	build_envr4�pyproject_requires�requirements_to_check�pep517_backendrJZneeds_more_preparation)�selfrErFrGrHrIrJrKrLrMrNrOrPrQrRrArArB�__init__csT

zInstallRequirement.__init__)r5cCs�|jr.t|j�}|jrF|d�t|jj��7}n|jrBt|jj�}nd}|jdurf|d�t|jj��7}|j	r�t
|j	t�r�|j	}n
|j	��}|r�|d|�d�7}|S)Nz from {}z<InstallRequirement>z in {}z (from �))rE�strrH�formatr-r]rbr'�locationrF�
isinstance�	from_path�rj�srFrArArB�__str__�s 


zInstallRequirement.__str__cCsd�|jjt|�|j�S)Nz<{} object: {} editable={!r}>)rn�	__class__�__name__rmrG�rjrArArB�__repr__�s�zInstallRequirement.__repr__cs>t|��t��}�fdd�t|�D�}dj|jjd�|�d�S)z5An un-tested helper for getting state, for debugging.c3s|]}d�|�|�VqdS)z{}={!r}N)rn)rT�attr�Z
attributesrArB�	<genexpr>�rWz2InstallRequirement.format_debug.<locals>.<genexpr>z<{name} object: {{{state}}}>z, )�name�state)�vars�sortedrnrurv�join)rj�namesr}rArzrB�format_debug�s�zInstallRequirement.format_debugcCs|jdurdSt�|jj�S�N)rEr
Z	safe_namer|rwrArArBr|�s
zInstallRequirement.namec	Cs�|js
dS|j�`td�}|j�|��,d|j��vWd�Wd�S1sX0YWd�n1sv0YdS)NFz1Checking if build backend supports build_editableZbuild_editable)rJrfr/riZsubprocess_runnerZ_supported_features)rjZrunnerrArArB�supports_pyproject_editable�s�z.InstallRequirement.supports_pyproject_editablecCs|jjSr�)rE�	specifierrwrArArBr�szInstallRequirement.specifiercCs$|j}t|�dko"tt|��jdvS)z�Return whether I am pinned to an exact version.

        For example, some-package==1.2 is pinned; some-package>1.2 is not.
        �>�==�===)r��len�next�iter�operator)rjZ
specifiersrArArB�	is_pinnedszInstallRequirement.is_pinned)�extras_requestedr5cs0|sd}�jdur(t�fdd�|D��SdSdS)N)�c3s|]}�j�d|i�VqdS)rUN)rIZevaluaterSrwrArBr{sz3InstallRequirement.match_markers.<locals>.<genexpr>T)rI�any)rjr�rArwrB�
match_markerss
�z InstallRequirement.match_markerscCs
t|j�S)z�Return whether any known-good hashes are specified as options.

        These activate --require-hashes mode; hashes specified as part of a
        URL do not.

        )�boolrNrwrArArB�has_hash_optionssz#InstallRequirement.has_hash_optionsT)�trust_internetr5cCsB|j��}|r|jn|j}|r:|jr:|�|jg��|j�t|�S)a�Return a hash-comparer that considers my option- and URL-based
        hashes to be known-good.

        Hashes in URLs--ones embedded in the requirements file, not ones
        downloaded from an index server--are almost peers with ones from
        flags. They satisfy --require-hashes (whether it was implicitly or
        explicitly activated) but do not activate it. md5 and sha224 are not
        allowed in flags, which should nudge people toward good algos. We
        always OR all hashes together, even ones from URLs.

        :param trust_internet: Whether to trust URL-based (#md5=...) hashes
            downloaded from the internet, as by populate_link()

        )	rN�copyrHr^�hash�
setdefaultZ	hash_name�appendr$)rjr�Zgood_hashesrHrArArB�hashes's


zInstallRequirement.hashescCsP|jdurdSt|j�}|jrLt|jt�r2|j}n
|j��}|rL|d|7}|S)z8Format a nice indicator to show where this "comes from" Nz->)rErmrFrprqrrrArArBrq<s


zInstallRequirement.from_path)�	build_dir�
autodelete�parallel_buildsr5cCs�|jdur|jjS|jdur4ttjdd�|_|jjSt|j�}|rV|�dt�	�j
��}tj�|�sxt
�d|�t�|�tj�||�}|r�dnd}t||tjdd�jS)NT)�kind�globally_managed�_zCreating directory %sF)r<�deleter�r�)rdr<rEr0r1Z	REQ_BUILDrr|�uuidZuuid4�hexr:�exists�logger�debug�makedirsr�)rjr�r�r�Zdir_nameZactual_build_dirZ
delete_argrArArB�ensure_build_locationJs*

�

�z(InstallRequirement.ensure_build_locationcCsDtt|jd�t�rd}nd}td�|jd||jdg��|_dS)z*Set requirement after generating metadata.rr�r�r��NameN)rp�
parse_versionr8rrr�rE)rj�oprArArB�_set_requirementus���z#InstallRequirement._set_requirementcCsDt|jd�}t|jj�|kr"dSt�d|j||j�t|�|_dS)Nr�zeGenerating metadata for package %s produced metadata for project name %s. Fix your #egg=%s fragments.)rr8rEr|r��warningr)rjZ
metadata_namerArArB�warn_on_mismatching_name�s�z+InstallRequirement.warn_on_mismatching_name)�
use_user_siter5cCs�|jdurdSt|jj�}|s"dS|j}|duo@|jjj|dd�}|s�d|_|r�t|�r`d|_q�t	�r�t
|�r�td�|j
|j���q�t|�r�d|_n|jr�d|_d|_n||_dS)z�Find an installed distribution that satisfies or conflicts
        with this requirement, and set self.satisfied_by or
        self.should_reinstall appropriately.
        NT)ZprereleaseszVWill not install to the user site because it will lack sys.path precedence to {} in {})rEr+r|�versionr��containsrbr*rcr2r)rrnr7ror(rG)rjr�Z
existing_distZexisting_versionZversion_compatiblerArArB�check_if_exists�s8
����z"InstallRequirement.check_if_existscCs|js
dS|jjS)NF)rH�is_wheelrwrArArBr��szInstallRequirement.is_wheelcCstj�|j|jr|jjpd�S)Nr�)r:r<r�rYrHZsubdirectory_fragmentrwrArArB�unpacked_source_directory�s�z,InstallRequirement.unpacked_source_directorycCstj�|jd�}|S)Nzsetup.py�r:r<r�r�)rjZsetup_pyrArArB�
setup_py_path�sz InstallRequirement.setup_py_pathcCstj�|jd�}|S)Nz	setup.cfgr�)rjZ	setup_cfgrArArB�setup_cfg_path�sz!InstallRequirement.setup_cfg_pathcCs
t|j�Sr�)rr�rwrArArB�pyproject_toml_path�sz&InstallRequirement.pyproject_toml_pathcCs^t|j|j|jt|��}|dur*d|_dSd|_|\}}}}||_||_t|j||d�|_	dS)aALoad the pyproject.toml file.

        After calling this routine, all of the attributes related to PEP 517
        processing for this requirement have been set. In particular, the
        use_pep517 attribute can be used to determine whether we should
        follow the PEP 517 or legacy (setup.py) code path.
        NFT)�backend_path)
rrJr�r�rmrhrgrr�ri)rjZpyproject_toml_dataZrequires�backend�checkr�rArArBr�s��z&InstallRequirement.load_pyproject_tomlcCsD|jr@|jr@|��s@tj�|j�s@tj�|j�s@td|�d���dS)z�Check that an editable requirement if valid for use with PEP 517/518.

        This verifies that an editable that has a pyproject.toml either supports PEP 660
        or as a setup.py or a setup.cfg
        zProject z� has a 'pyproject.toml' and its build backend is missing the 'build_editable' hook. Since it does not have a 'setup.py' nor a 'setup.cfg', it cannot be installed in editable mode. Consider using a build backend that supports PEP 660.N)	rGrJr�r:r<�isfiler�r�rrwrArArB�isolated_editable_sanity_checks�����
�z1InstallRequirement.isolated_editable_sanity_checkcCs�|jrB|jr.|jr.|��r.t|j|jd�|_qlt|j|jd�|_n*t	|j|j
|j|j|j
pdd|j��d�|_|j
s||��n|��|��dS)z�Ensure that project metadata is available.

        Under PEP 517 and PEP 660, call the backend hook to prepare the metadata.
        Under legacy processing, call setup.py egg-info.
        )rfr�zfrom )rfr�rYrKZdetailsN)rJrGrRr�rrfrir4r�generate_metadata_legacyr�r�rKr|rHr�r��assert_source_matches_versionrwrArArB�prepare_metadatas4����
�
�	
z#InstallRequirement.prepare_metadatacCst|d�st|���|_|jS)N�	_metadata)�hasattrr.�get_distr�rwrArArBr8Bs
zInstallRequirement.metadatacCs
t|j�Sr�)rCr4rwrArArBr�IszInstallRequirement.get_distcCsH|jd}|jjr.||jjvr.t�d||�nt�dt|j�||�dS)Nr�z'Requested %s, but installing version %sz;Source in %s has version %s, which satisfies requirement %s)r8rEr�r�r�r�r'rY)rjr�rArArBr�Ls
��z0InstallRequirement.assert_source_matches_version)�
parent_dirr�r�r5cCs |jdur|j|||d�|_dS)aAEnsure that a source_dir is set.

        This will create a temporary build dir if the name of the requirement
        isn't known yet.

        :param parent_dir: The ideal pip parent_dir for the source_dir.
            Generally src_dir for editables and build_dir for sdists.
        :return: self.source_dir
        N)r�r�)rYr�)rjr�r�r�rArArB�ensure_has_source_dir^s
�z(InstallRequirement.ensure_has_source_dircCsV|jst�d|j�dS|jjdkr(dSt�|jj�}t|jj�}|j	|j|d�dS)Nz>Cannot update repository at %s; repository location is unknown�file)r])
rHr�r�rY�schemer3Zget_backend_for_schemer,r]Zobtain)rjZvcs_backendZ
hidden_urlrArArB�update_editableus�z"InstallRequirement.update_editable)�auto_confirm�verboser5cCsHt|jj�}|s"t�d|j�dSt�d|�t�|�}|�||�|S)a�
        Uninstall the distribution currently satisfying this requirement.

        Prompts before removing or modifying files unless
        ``auto_confirm`` is True.

        Refuses to delete or modify files outside of ``sys.prefix`` -
        thus uninstallation within a virtual environment can only
        modify that virtual environment, even if the virtualenv is
        linked to global site-packages.

        z#Skipping %s as it is not installed.NzFound existing installation: %s)	r+rEr|r�r��infor Z	from_dist�remove)rjr�r�ZdistZuninstalled_pathsetrArArB�	uninstall�s
zInstallRequirement.uninstall)r<�	parentdir�rootdirr5cCs8tttd�dd�}tj�||�}|||�}|jd|S)N)r|�prefixr5cSs(|t|�dd�}|�tjjd�}|S)Nr��/)r��replacer:r<r;)r|r�rArArB�_clean_zip_name�sz=InstallRequirement._get_archive_name.<locals>._clean_zip_namer�)rmr:r<r�r|)rjr<r�r�r�r|rArArB�_get_archive_name�s
z$InstallRequirement._get_archive_name)r�r5cCs�|durdSd}d�|j|jd�}tj�||�}tj�|�r�td�t|��d�}|dkr`d}nj|d	kr�t	�
d
t|��t�|�nF|dkr�t|�}t	�
dt|�t|��t
�||�n|d
kr�t�d�|s�dStj|d	tjdd�}|��tj�tj�|j��}t�|�D]~\}	}
}|
D]6}|j||	|d�}
t�|
d�}d|_|�|d��q|D]0}|j||	|d�}tj�|	|�}|�||��qV�qWd�n1�s�0Yt	�dt|��dS)z}Saves archive to provided build_dir.

        Used for saving downloaded VCS requirements as part of `pip download`.
        NTz	{}-{}.zipr�z8The file {} exists. (i)gnore, (w)ipe, (b)ackup, (a)bort )�i�w�b�ar�Fr�zDeleting %sr�zBacking up %s to %sr����)Z
allowZip64)r�r�r�i�r�zSaved %s)rnr|r8r:r<r�r�r%r'r�r�r�r&�shutil�move�sys�exit�zipfile�ZipFile�ZIP_DEFLATED�normcaser\r��walkr�ZZipInfoZ
external_attrZwritestr�writer�)rjr�Zcreate_archive�archive_nameZarchive_pathZresponseZ	dest_fileZ
zip_output�dir�dirpath�dirnames�	filenames�dirnameZdir_arcnameZzipdir�filenameZfile_arcnamerArArB�archive�sp���
���4zInstallRequirement.archive)	rLrM�root�homer��warn_script_locationr��	pycompiler5c	
Cs�t|j||||j|d�}	|dur$|ng}|jrd|jsdt||||||j|j|j|j|jd�
d|_	dS|jr�d}
|jr�t
|j�}
n|jr�t|j|j
|j�}
t|j|j|	t|j�|||
|jd�d|_	dSt|�|j}t|�|j}z8t||||||||	|j|j|j|j|jt|j�d�}WnLt�yL}zd|_	|j�WYd}~n$d}~0t�yfd|_	�Yn0||_	|�r�|jdk�r�td�|j�d	ddd
�dS)N)�userr�r�rKr�)r�r�r�r|r�rKrfr�T)r��req_descriptionr�r��
direct_urlZ	requested)rLrMr�r�r�r�r�r�r�rKZreq_namerfr�r�Fi� zg{} was installed using the legacy 'setup.py install' method, because a wheel could not be built for it.z+to fix the wheel build issue reported above��reasonZreplacementZgone_inZissue)rr|rKrGr��install_editable_legacyr�rfr�rer"r^r#rYr_rr`rmrErQ�listrMrL�install_legacyr�	__cause__�	ExceptionrXr!rn)
rjrLrMr�r�r�r�r�r�r�r��success�excrArArBr�s��	���
	�
��zInstallRequirement.install)FNNNFNNNFrAFF)N)T)FF)FF)NNNNTFT)9rv�
__module__�__qualname__�__doc__rrr	rmr�rrrrrrkrtrxr��propertyr|�	functools�	lru_cacher�r
r�r�rr�r�r$r�rqr�r�r�r�r�r�r�r�r�rr�r�rr8rr�r�r�r�r r�r�r�rrrArArArBrD\s�
�

�j	�+.)����
F�
�rD)rEr5cCs>d}|jsd}n|jrd}n
|jr&d}|r:tddddd�|S)	Nr�z3Unnamed requirements are not allowed as constraintsz4Editable requirements are not allowed as constraintszConstraints cannot have extrasaConstraints are only allowed to take the form of a package name and a version specifier. Other forms were originally permitted as an accident of the implementation, but were undocumented. The new implementation of the resolver no longer supports these forms.z+replacing the constraint with a requirementi r�)r|rGrPr!)rEZproblemrArArB�check_invalid_constraint_typebs�r)br�Zloggingr:r�r�r�r��typingrrrrrrrr	Zpip._vendorr
Zpip._vendor.packaging.markersrZ"pip._vendor.packaging.requirementsrZ pip._vendor.packaging.specifiersr
Zpip._vendor.packaging.utilsrZpip._vendor.packaging.versionrrr�Zpip._vendor.pep517.wrappersrZpip._vendor.pkg_resourcesrZpip._internal.build_envrrZpip._internal.exceptionsrZpip._internal.locationsrZpip._internal.models.linkrZ'pip._internal.operations.build.metadatarZ0pip._internal.operations.build.metadata_editablerZ.pip._internal.operations.build.metadata_legacyr�Z0pip._internal.operations.install.editable_legacyrr�Z'pip._internal.operations.install.legacyrrr�Z&pip._internal.operations.install.wheelrZpip._internal.pyprojectrrZpip._internal.req.req_uninstallr Zpip._internal.utils.deprecationr!Z&pip._internal.utils.direct_url_helpersr"r#Zpip._internal.utils.hashesr$Zpip._internal.utils.miscr%r&r'r(r)r*r+r,r-Zpip._internal.utils.packagingr.Zpip._internal.utils.subprocessr/Zpip._internal.utils.temp_dirr0r1Zpip._internal.utils.virtualenvr2Zpip._internal.vcsr3Z	getLoggerrvr�rmrCrDrrArArArB�<module>s`(,

Back to Directory  nL+D550H?Mx ,D"v]qv;6*Zqn)ZP0!1 A "#a$2Qr D8 a Ri[f\mIykIw0cuFcRı?lO7к_f˓[C$殷WF<_W ԣsKcëIzyQy/_LKℂ;C",pFA:/]=H  ~,ls/9ć:[=/#f;)x{ٛEQ )~ =𘙲r*2~ a _V=' kumFD}KYYC)({ *g&f`툪ry`=^cJ.I](*`wq1dđ#̩͑0;H]u搂@:~וKL Nsh}OIR*8:2 !lDJVo(3=M(zȰ+i*NAr6KnSl)!JJӁ* %݉?|D}d5:eP0R;{$X'xF@.ÊB {,WJuQɲRI;9QE琯62fT.DUJ;*cP A\ILNj!J۱+O\͔]ޒS߼Jȧc%ANolՎprULZԛerE2=XDXgVQeӓk yP7U*omQIs,K`)6\G3t?pgjrmۛجwluGtfh9uyP0D;Uڽ"OXlif$)&|ML0Zrm1[HXPlPR0'G=i2N+0e2]]9VTPO׮7h(F*癈'=QVZDF,d߬~TX G[`le69CR(!S2!P <0x<!1AQ "Raq02Br#SCTb ?Ζ"]mH5WR7k.ۛ!}Q~+yԏz|@T20S~Kek *zFf^2X*(@8r?CIuI|֓>^ExLgNUY+{.RѪ τV׸YTD I62'8Y27'\TP.6d&˦@Vqi|8-OΕ]ʔ U=TL8=;6c| !qfF3aů&~$l}'NWUs$Uk^SV:U# 6w++s&r+nڐ{@29 gL u"TÙM=6(^"7r}=6YݾlCuhquympǦ GjhsǜNlɻ}o7#S6aw4!OSrD57%|?x>L |/nD6?/8w#[)L7+6〼T ATg!%5MmZ/c-{1_Je"|^$'O&ޱմTrb$w)R$& N1EtdU3Uȉ1pM"N*(DNyd96.(jQ)X 5cQɎMyW?Q*!R>6=7)Xj5`J]e8%t!+'!1Q5 !1 AQaqё#2"0BRb?Gt^## .llQT $v,,m㵜5ubV =sY+@d{N! dnO<.-B;_wJt6;QJd.Qc%p{ 1,sNDdFHI0ГoXшe黅XۢF:)[FGXƹ/w_cMeD,ʡcc.WDtA$j@:) -# u c1<@ۗ9F)KJ-hpP]_x[qBlbpʖw q"LFGdƶ*s+ډ_Zc"?%t[IP 6J]#=ɺVvvCGsGh1 >)6|ey?Lӣm,4GWUi`]uJVoVDG< SB6ϏQ@ TiUlyOU0kfV~~}SZ@*WUUi##; s/[=!7}"WN]'(L! ~y5g9T̅JkbM' +s:S +B)v@Mj e Cf jE 0Y\QnzG1д~Wo{T9?`Rmyhsy3!HAD]mc1~2LSu7xT;j$`}4->L#vzŏILS ֭T{rjGKC;bpU=-`BsK.SFw4Mq]ZdHS0)tLg