id\ dZddlZddlZddlZddlZddlZddlZddlZddlm Z m Z m Z ddl m Z mZmZmZmZmZddlmZmZddlmZmZmZddlmZddlmZe rdd lmZdd l m Z dd l!m"Z"dd l#m$Z$ej%e&Z'd e(de)fdZ*d eee(fdede(de(def dZ+Gdde,Z-Gdde-Z.Gdde-Z/Gdde-Z0Gdde-Z1Gdde.Z2Gd d!e.Z3Gd"d#e-Z4Gd$d%e0Z5Gd&d'e0Z6Gd(d)e0Z7Gd*d+e0Z8Gd,d-e-Z9Gd.d/e-Z:Gd0d1e-Z;Gd2d3e-Z<Gd4d5e-Z=Gd6d7e0Z>Gd8d9e0Z?Gd:d;e0Z@Gd<d=e0ZAGd>d?e.e0ZBGd@dAeBe0ZCGdBdCe0ZDGdDdEe0ZEGdFdGeEZFGdHdIeEZGGdJdKeEZHGdLdMeEZIGdNdOeEZJGdPdQe0ZKGdRdSe/ZLdTejMdUZNGdVdWe.ZOdS)XzExceptions used throughout package. This module MUST NOT try to import from anything within `pip._internal` to operate. This is expected to be importable from any/all files within the subpackage and, thus, should not depend on them. N)chaingroupbyrepeat) TYPE_CHECKINGDictIteratorListOptionalUnion)RequestResponse)ConsoleConsoleOptions RenderResult)escape)Text)_Hash)Literal)BaseDistribution)InstallRequirementsreturnc0tjd|duS)Nz^[a-z]+(-[a-z]+)*$)rematch)rs M/opt/cloudlinux/venv/lib/python3.11/site-packages/pip/_internal/exceptions.py_is_kebab_caser$s 8)1 - -T 99consoleprefixindentct|tr|}n||}||d|d|d|dzS)Nignore)overflow T) allow_blank) isinstancer render_strjoinsplit)rrr r!texts r_prefix_with_indentr,(s!T%!!!$$   fx  8 87;M;MV ) hasattrr7rr9r<r=r:r>r;super__init__ __class__r0) selfr9r7r<r=r>r:r;rEs rrDzDiagnosticPipError.__init__Js  4-- N N/N N N NIi((OO*OOOO "  ""  IT^4IIIIIJJJJJrc rd|jjd|jd|jd|jd|jd|jd S)Nr@z (reference=z , message=z , context=z , note_stmt=z , hint_stmt=z)>)rEr0r7r<r=r:r>rFs r__repr__zDiagnosticPipError.__repr__hss '    |  |           rroptionsc#PK|jdkrdnd}d|d|jd|jdVdV|jsg|jEt |j|d|d d|d  Vt |j|d|d d|d  Vn8t |j|dd Vn|jV|j dV|jV|j|jdV|jt |j|dd V|jt |j|dd V|jdVd|jVdSdS)Nr8redyellow[z bold]z [/]: [bold]z[/]u]×[/] u]│[/] )r r!u ]╰─>[/] z] [/] u [red]×[/] z z[magenta bold]note[/]: z z[cyan bold]hint[/]: zLink: ) r9r7 ascii_onlyr=r,r<r:r>r;)rFrrJcolours r__rich_console__z#DiagnosticPipError.__rich_console__ss )w..HI&II IIdnIIIIII! #|')L.v.../v///  *L3v333/v/// *L( ,   |'l""" > %)CHHH > %%0     > %%-     9 HHH&49&& & & & & & ! r)r0r1r2r3str__annotations__r r rrDrIrrrrR __classcell__rEs@rr6r6=sTNNN /6#'15"KKK,KC= K sDy! K %T *+ KE#t),-KE#t),-KsmK KKKKKK<  #     :':' :'  :':':':':':':':'rr6ceZdZdZdS)ConfigurationErrorz"General exception in configurationNr/r4rrrXrXs,,,,rrXceZdZdZdS)InstallationErrorz%General exception during installationNr/r4rrrZrZs////rrZceZdZdZdS)UninstallationErrorz'General exception during uninstallationNr/r4rrr\r\s1111rr\c0eZdZdZdZdeddffd ZxZS)MissingPyProjectBuildRequireszNRaised when pyproject.toml has `build-system`, but no `build-system.requires`.z'missing-pyproject-build-system-requirespackagerNctdt|tddtddS)NCan not process zrThis package has an invalid pyproject.toml file. The [build-system] table is missing the mandatory `requires` key.;This is an issue with the package mentioned above, not pip.+See PEP 518 for the detailed specification.r<r=r:r>rCrDrr)rFr_rEs rrDz&MissingPyProjectBuildRequires.__init__sd 8vg88TTHII      rr0r1r2r3r7rSrDrUrVs@rr^r^sVXX9I  3  4           rr^c4eZdZdZdZdededdffd ZxZS)InvalidPyProjectBuildRequiresz>Raised when pyproject.toml an invalid `build-system.requires`.z'invalid-pyproject-build-system-requiresr_reasonrNctdt|td|dtddS)NrazKThis package has an invalid `build-system.requires` key in pyproject.toml. rbrcrdre)rFr_rirEs rrDz&InvalidPyProjectBuildRequires.__init__sp 8vg88-$*--THII      rrfrVs@rrhrhs]HH9I  3               rrhc2eZdZdZdddeddfdZdefdZdS) NoneMetadataErrora4Raised when accessing a Distribution's "METADATA" or "PKG-INFO". This signifies an inconsistency, when the Distribution claims to have the metadata file (if not, raise ``FileNotFoundError`` instead), but is not actually able to produce its content. This may be due to permission errors. distr metadata_namerNc"||_||_dS)z :param dist: A Distribution object. :param metadata_name: The name of the metadata being accessed (can be "METADATA" or "PKG-INFO"). N)rmrn)rFrmrns rrDzNoneMetadataError.__init__s *rcBd|j|jS)Nz+None {} metadata found for distribution: {})formatrnrmrHs r__str__zNoneMetadataError.__str__s'=CC   I   rr0r1r2r3rSrDrrr4rrrlrlsi +  + +  + + + +       rrlceZdZdZdefdZdS)UserInstallationInvalidzBA --user install is requested on an environment without user site.rcdS)Nz$User base directory is not specifiedr4rHs rrrzUserInstallationInvalid.__str__s55rN)r0r1r2r3rSrrr4rrrurus5LL6666666rruceZdZdefdZdS)InvalidSchemeCombinationrcdd|jddD}d|d|jddS)Nz, c34K|]}t|VdSN)rS).0as r z3InvalidSchemeCombination.__str__.. s(::a3q66::::::rz Cannot set z and z together)r)args)rFbefores rrrz InvalidSchemeCombination.__str__sK::49SbS>:::::BVBB$)B-BBBBrN)r0r1r2rSrrr4rrrxrxs6CCCCCCCrrxceZdZdZdS)DistributionNotFoundzCRaised when a distribution cannot be found to satisfy a requirementNr/r4rrrr sMMMMrrceZdZdZdS)RequirementsFileParseErrorzDRaised when a general error occurs parsing a requirements file line.Nr/r4rrrrsNNNNrrceZdZdZdS)BestVersionAlreadyInstalledzNRaised when the most up-to-date version of a package is already installed.Nr/r4rrrrsrrceZdZdZdS) BadCommandz0Raised when virtualenv or a command is not foundNr/r4rrrrs::::rrceZdZdZdS) CommandErrorz7Raised when there is an error in command-line argumentsNr/r4rrrrsAAAArrceZdZdZdS)PreviousBuildDirErrorz:Raised when there's a previous conflicting build directoryNr/r4rrrr"sDDDDrrc ^eZdZdZ d dedeedeeddffd ZdefdZ xZ S) NetworkConnectionErrorzHTTP connection errorN error_msgresponserequestrc||_||_||_|j(|js!t|dr|jj|_t |||dS)zc Initialize NetworkConnectionError with `request` and `response` objects. Nr)rrrrBrCrD)rFrrrrEs rrDzNetworkConnectionError.__init__)sn!  " M %L &),, & =0DL Hg66666rc*t|jSr{)rSrrHs rrrzNetworkConnectionError.__str__>s4>"""r)NN) r0r1r2r3rSr r r rDrrrUrVs@rrr&s (,%) 7778$7'" 7  777777*#########rrceZdZdZdS)InvalidWheelFilenamezInvalid wheel filename.Nr/r4rrrrBs!!!!rrceZdZdZdS)UnsupportedWheelzUnsupported wheel.Nr/r4rrrrFsrrc.eZdZdZdedefdZdefdZdS) InvalidWheelzInvalid (e.g. corrupt) wheel.locationnamec"||_||_dSr{)rr)rFrrs rrDzInvalidWheel.__init__Ms   rrc(d|jd|jdS)NzWheel 'z ' located at z is invalid.)rrrHs rrrzInvalidWheel.__str__QsLLLLLLLrNrsr4rrrrJs^''CMMMMMMMrrc :eZdZdZdddedededdf d Zdefd ZdS) MetadataInconsistentaBuilt metadata contains inconsistent information. This is raised when the metadata contains values (e.g. name and version) that do not match the information previously obtained from sdist filename, user-supplied ``#egg=`` value, or an install requirement name. ireqrfieldf_valm_valrNc>||_||_||_||_dSr{rrrr)rFrrrrs rrDzMetadataInconsistent.__init__]s$    rcFd|jd|jd|jd|jS)Nz Requested z has inconsistent z : expected z, but metadata has rrHs rrrzMetadataInconsistent.__str__esO H H Hdj H H  H H9= H H rrsr4rrrrUsu(14=@IL        rrc\eZdZdZdZdededeeeddffd Z defd Z xZ S) InstallationSubprocessErrorzA subprocess call failed.zsubprocess-exited-with-errorcommand_description exit_code output_linesrNcr|td}n]tjdt|dtd|ztjdz}t dt |d||dd ||_||_dS) NzSee above for output.z[red][z lines of output][/] rOz[red]\[end of output][/]z[green]z)[/] did not run successfully. exit code: zNThis error originates from a subprocess, and is likely not a problem with pip.r<r=r>r:) r from_markuplenr)rCrDrrr)rFrrr output_promptrEs rrDz$InstallationSubprocessError.__init__qs   !899MM !S#l*;*;!S!S!STTrww|,,--."#>??@  *&!455**'**"$  $7 "rc$|jd|jS)Nz exited with )rrrHs rrrz#InstallationSubprocessError.__str__s*IIIIIr) r0r1r2r3r7rSintr r rDrrrUrVs@rrrls##.I#!# # tCy) #  ######@JJJJJJJJJrrc8eZdZdZdeddffd ZdefdZxZS)MetadataGenerationFailedzmetadata-generation-failedpackage_detailsrNcztt|dt|dddS)Nz4Encountered error while generating package metadata.zSee above for details.rbr)rCrrDr)rFrrEs rrDz!MetadataGenerationFailed.__init__sK )40099J?++.S :     rcdS)Nzmetadata generation failedr4rHs rrrz MetadataGenerationFailed.__str__s++r)r0r1r2r7rSrDrrrUrVs@rrrsq,I            ,,,,,,,,,rrc:eZdZdZd dZd dZdefdZdefd Z dS) HashErrorsz:Multiple HashError instances rolled into one for reportingrNcg|_dSr{)errorsrHs rrDzHashErrors.__init__s )+ rr8 HashErrorc:|j|dSr{)rappend)rFr8s rrzHashErrors.appends 5!!!!!rcg}|jdt|jdD]>\}}||j|d|D?|rd|SdS)Nc|jSr{)orderes rz$HashErrors.__str__..sqwr)keyc|jSr{rVrs rrz$HashErrors.__str__..src3>K|]}|VdSr{)body)r|rs rr~z%HashErrors.__str__..s*99a999999rr%rO)rsortrrheadextendr))rFlinescls errors_of_clss rrrzHashErrors.__str__s ..///")$+7L7L"M"M : : C LL " " " LL99=999 9 9 9 9  $99U## #rrc*t|jSr{)boolrrHs r__bool__zHashErrors.__bool__sDK   r)rN)r8rrN) r0r1r2r3rDrrSrrrrr4rrrrsxDD,,,,""""!$!!!!!!rrcdeZdZUdZdZeded<dZdZe ed<de fd Z de fd Z de fd Z dS) ra A failure to verify a package against known-good hashes :cvar order: An int sorting hash exception classes by difficulty of recovery (lower being harder), so the user doesn't bother fretting about unpinned packages when he has deeper issues, like VCS dependencies, to deal with. Also keeps error reports in a deterministic order. :cvar head: A section heading for display above potentially many exceptions of this kind :ivar req: The InstallRequirement that triggered this error. This is pasted on after the exception is instantiated, because it's not typically available earlier. NrreqrOrrrc0d|S)a=Return a summary of me for display under the heading. This default implementation simply prints a description of the triggering requirement. :param req: The InstallRequirement that provoked this error, with its link already populated by the resolver's _populate_link(). z )_requirement_namerHs rrzHashError.bodys1d,,..000rc>|jd|S)Nr%)rrrHs rrrzHashError.__str__s ),,tyy{{,,,rc<|jrt|jndS)zReturn a description of the requirement that triggered me. This default implementation returns long description of the req, with line numbers unknown package)rrSrHs rrzHashError._requirement_names!%?s48}}}.??r)r0r1r2r3rr rTrrrrSrrrrr4rrrrs +/C& '... DE3OOO 1c 1 1 1 1-----@3@@@@@@rrceZdZdZdZdZdS)VcsHashUnsupporteduA hash was provided for a version-control-system-based requirement, but we don't have a method for hashing those.rzlCan't verify hashes for these requirements because we don't have a way to hash version control repositories:Nr0r1r2r3rrr4rrrrs)11 E ; DDrrceZdZdZdZdZdS)DirectoryUrlHashUnsupportedrzUCan't verify hashes for these file:// requirements because they point to directories:Nrr4rrrrs)11 E  DDrrc6eZdZdZdZdZdeddfdZdefdZdS) HashMissingz2A hash was needed for a requirement but is absent.awHashes are required in --require-hashes mode, but they are missing from some requirements. Here is a list of those requirements along with the hashes their downloaded archives actually had. Add lines like these to your requirements files to prevent tampering. (If you did not enable --require-hashes manually, note that it turns on automatically when any package has a hash.) gotten_hashrNc||_dS)zq :param gotten_hash: The hash of the (possibly malicious) archive we just downloaded N)r)rFrs rrDzHashMissing.__init__s 'rcddlm}d}|jr.|jjr |jjnt |jdd}d|pd||jS)Nr) FAVORITE_HASHrz {} --hash={}:{}r)pip._internal.utils.hashesrr is_direct original_linkgetattrrqr)rFrr_s rrzHashMissing.bodys~<<<<<< 8  8%4&&TXud33 %++  ((-9I   r) r0r1r2r3rrrSrDrr4rrrrsf<< E  'C'D'''' c      rrceZdZdZdZdZdS) HashUnpinnedzPA requirement had a hash specified but was not pinned to a specific version.zaIn --require-hashes mode, all requirements must have their versions pinned with ==. These do not:Nrr4rrrr-s) E 1 DDrrcreZdZdZdZdZdeeeefdeedfddfd Z defd Z defd Z dS) HashMismatchz Distribution file hash values don't match. :ivar package_name: The name of the package that triggered the hash mismatch. Feel free to write to this after the exception is raise to improve its error message. zTHESE PACKAGES DO NOT MATCH THE HASHES FROM THE REQUIREMENTS FILE. If you have updated the package versions, please update the hashes. Otherwise, examine the package contents carefully; someone may have tampered with them.allowedgotsrrNc"||_||_dS)z :param allowed: A dict of algorithm names pointing to lists of allowed hex digests :param gots: A dict of algorithm names pointing to hashes we actually got from the files under suspicion N)rr)rFrrs rrDzHashMismatch.__init__Js  rcvd||S)Nz {}: {})rqr_hash_comparisonrHs rrzHashMismatch.bodyTs0##D$:$:$<$S>S>U>UVVVrcldtddfd}g}|jD]v\}}|||fd|D|d|j|wd|S)aE Return a comparison of actual and expected hash values. Example:: Expected sha256 abcdeabcdeabcdeabcdeabcdeabcdeabcdeabcdeabcde or 123451234512345123451234512345123451234512345 Got bcdefbcdefbcdefbcdefbcdefbcdefbcdefbcdefbcdef hash_namerz chain[str]c>t|gtdS)Nz or)rr)rs r hash_then_orz3HashMismatch._hash_comparison..hash_then_orcs)fX&6&677 7rc3^K|]'}dt|V(dS)z Expected {} {}N)rqnext)r|rr s rr~z0HashMismatch._hash_comparison..ksKGH)00fqAArz Got {} r%) rSritemsrrrqr hexdigestr))rFrrr expectedsr s @rrzHashMismatch._hash_comparisonWs 8C 8L 8 8 8 8 $(L$6$6$8$8   Iy!\),,F LLLU    LL.55di 6J6T6T6V6VWW    yyr) r0r1r2r3rrrrSr rDrrr4rrrr8s E / S$s)^ 4Dg>##6#6 q'v'''''' s ( 77configctjd} ||d|d}|D]F}t jt 5|||cdddcS#1swxYwYGnj#t $rYn^tttj f$r@ddl m }t |}td||YnwxYw|dS) N) interpolationzutf-8)encodingzexternally-managedr)VERBOSEzFailed to read %s)exc_info)r  ConfigParserreadr contextlibsuppressKeyErrorOSErrorUnicodeDecodeError ParsingErrorpip._internal.utils._logr!logger isEnabledForwarning)rrparsersectionrr!r"s r from_configz(ExternallyManagedEnvironment.from_configs *>>> K KKK 1 1 112G>>@@ - -(22--3ws|,,------------------- -    D+\-FG K K K 8 8 8 8 8 8**733H NN.N J J J J J  K s4yys=AB%B6BB B B B C9AC98C9)r0r1r2r3r7r rSrD staticmethodrr classmethodr pathlibPathr1rUrVs@rr r s1I hsm       "#\*glC'( ([rr )Pr3r r%rloggingr4rsys itertoolsrrrtypingrrrr r r pip._vendor.requests.modelsr r pip._vendor.rich.consolerrrpip._vendor.rich.markuprpip._vendor.rich.textrhashlibrrpip._internal.metadatarpip._internal.req.req_installr getLoggerr0r,rSrrr, Exceptionr.r6rXrZr\r^rhrlrurxrrrrrrrrrrrrrrrrrrrrrrr rr r4rrrCs  ,,,,,,,,,,GGGGGGGGGGGGGGGG99999999JJJJJJJJJJ******&&&&&&A777777@@@@@@  8 $ $ :c:d::::) T3Y) )  )  )  ))))"yp'p'p'p'p'p'p'p'l--------0000000022222(222     $6   "     $6   "        >66666/666CCCCC0CCC NNNNN,NNNOOOOO!2OOO( ;;;;;;;;BBBBB8BBBEEEEEHEEE#####X###8""""","""(MMMMM$MMM     ,   .&J&J&J&J&J"46G&J&J&JR,,,,,: