7iR\ 8dZddlZddlZddlZddlZddlZddlZddlZddlm Z m Z m Z ddl m Z mZmZmZmZmZddlmZmZddlmZmZmZddlmZddlmZe rdd lmZdd l m Z dd l!m"Z"dd l#m$Z$ejJe&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/ZLdTejdUZNGdVdWe.ZOy)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)InstallRequirementsreturnc2tjd|duS)Nz^[a-z]+(-[a-z]+)*$)rematch)rs a/mnt/ssd/data/python-lab/ChefSystem/venv/lib/python3.12/site-packages/pip/_internal/exceptions.py_is_kebab_caser$s 88)1 -T 99consoleprefixindentct|tr|}n|j|}|j|d|jd|dj|j dzS)Nignore)overflow T) allow_blank) isinstancer render_strjoinsplit)rrr r!texts r_prefix_with_indentr,(ss!T!!!$   fx  87;M;M VH ) hasattrr7rr9r<r=r:r>r;super__init__ __class__r0) selfr9r7r<r=r>r:r;rEs rrDzDiagnosticPipError.__init__Js  4- N/N N-Ii(O*OO( "  ""  1T^^445R7GqIJrc d|jjd|jd|jd|jd|j d|j d S)Nr@z (reference=z , message=z , context=z , note_stmt=z , hint_stmt=z)>)rEr0r7r<r=r:r>rFs r__repr__zDiagnosticPipError.__repr__hsl''()*+||&'||&'*+*    rroptionsc#K|jdk(rdnd}d|d|jd|jdd|jso|jGt |j |d|d d|d  t |j|d|d d|d  nHt |j |dd n,|j |jd|j|j |jd|j t |j |dd |jt |j|dd |jdd|jyyw)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.H& {+dnn5ESII!!||')LLvhg.vhh/  *LLvhl3vhh/ *LL( ,, ||'ll" >> %)CH >> %%0   >> %%-   99 H499+& & !sE.E0)r0r1r2r3str__annotations__r r rrDrIrrrrR __classcell__rEs@rr6r6=sN /6#'15"K,KC= K sDy! K %T *+ KE#t),-KE#t),-KsmK K<  #  :':' :'  :'rr6ceZdZdZy)ConfigurationErrorz"General exception in configurationNr/r4rrrXrXs,rrXceZdZdZy)InstallationErrorz%General exception during installationNr/r4rrrZrZs/rrZceZdZdZy)UninstallationErrorz'General exception during uninstallationNr/r4rrr\r\s1rr\c0eZdZdZdZdeddffd ZxZS)MissingPyProjectBuildRequireszNRaised when pyproject.toml has `build-system`, but no `build-system.requires`.z'missing-pyproject-build-system-requirespackagerNcht|dt|tddtdy)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__sA &vg&78TTHI  rr0r1r2r3r7rSrDrUrVs@rr^r^s#X9I  3  4   rr^c4eZdZdZdZdededdffd ZxZS)InvalidPyProjectBuildRequiresz>Raised when pyproject.toml an invalid `build-system.requires`.z'invalid-pyproject-build-system-requiresr_reasonrNcnt|dt|td|dtdy)NrazKThis package has an invalid `build-system.requires` key in pyproject.toml. rbrcrdre)rFr_rirEs rrDz&InvalidPyProjectBuildRequires.__init__sJ &vg&78$$*8-THI  rrfrVs@rrhrhs*H9I  3       rrhc0eZdZdZdddeddfdZdefdZy) 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 ||_||_y)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 *rc:d|jd|jS)NzNone z" metadata found for distribution: )rnrmrHs r__str__zNoneMetadataError.__str__s#t))**LTYYKXXrr0r1r2r3rSrDrqr4rrrlrls6 +  + +  +YYrrlceZdZdZdefdZy)UserInstallationInvalidzBA --user install is requested on an environment without user site.rcy)Nz$User base directory is not specifiedr4rHs rrqzUserInstallationInvalid.__str__s5rN)r0r1r2r3rSrqr4rrrtrtsL66rrtceZdZdefdZy)InvalidSchemeCombinationrcxdjd|jddD}d|d|jddS)Nz, c32K|]}t|ywN)rS).0as r z3InvalidSchemeCombination.__str__..s:a3q6:sz Cannot set z and z together)r)args)rFbefores rrqz InvalidSchemeCombination.__str__s=:499Sb>::VHE$))B- BBrN)r0r1r2rSrqr4rrrwrwsCCrrwceZdZdZy)DistributionNotFoundzCRaised when a distribution cannot be found to satisfy a requirementNr/r4rrrr sMrrceZdZdZy)RequirementsFileParseErrorzDRaised when a general error occurs parsing a requirements file line.Nr/r4rrrrsNrrceZdZdZy)BestVersionAlreadyInstalledzNRaised when the most up-to-date version of a package is already installed.Nr/r4rrrrsrrceZdZdZy) BadCommandz0Raised when virtualenv or a command is not foundNr/r4rrrrs:rrceZdZdZy) CommandErrorz7Raised when there is an error in command-line argumentsNr/r4rrrrsArrceZdZdZy)PreviousBuildDirErrorz:Raised when there's a previous conflicting build directoryNr/r4rrrrsDrrc ReZdZdZ d dedeedeeddffd ZdefdZ xZ S) NetworkConnectionErrorzHTTP connection errorN error_msgresponserequestrc||_||_||_|j3|js't|dr|jj|_t||||y)zc Initialize NetworkConnectionError with `request` and `response` objects. Nr)rrrrBrCrD)rFrrrrEs rrDzNetworkConnectionError.__init__&sW!  " MM %LL),==00DL Hg6rc,t|jSrz)rSrrHs rrqzNetworkConnectionError.__str__;s4>>""r)NN) r0r1r2r3rSr r r rDrqrUrVs@rrr#sO (,%) 778$7'" 7  7*##rrceZdZdZy)InvalidWheelFilenamezInvalid wheel filename.Nr/r4rrrr?s!rrceZdZdZy)UnsupportedWheelzUnsupported wheel.Nr/r4rrrrCsrrc,eZdZdZdedefdZdefdZy) InvalidWheelzInvalid (e.g. corrupt) wheel.locationnamec ||_||_yrz)rr)rFrrs rrDzInvalidWheel.__init__Js   rrc<d|jd|jdS)NzWheel 'z ' located at z is invalid.)rrrHs rrqzInvalidWheel.__str__Ns =|LLrNrrr4rrrrGs&'CMMrrc 8eZdZdZdddedededdf d Zdefd Zy) 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<||_||_||_||_yrzrrrr)rFrrrrs rrDzMetadataInconsistent.__init__Zs     rcnd|jd|jd|jd|jS)Nz Requested z has inconsistent z : expected z, but metadata has rrHs rrqzMetadataInconsistent.__str__bs= #5djj\B ~%8 H rrrr4rrrrRs@(14=@IL   rrcPeZdZdZdZdededeeeddffd Z defd Z xZ S) InstallationSubprocessErrorzA subprocess call failed.zsubprocess-exited-with-errorcommand_description exit_code output_linesrNc(| td}nStjdt|dtdj|ztjdz}t|dt |d||dd ||_||_y) 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__ns   !89M  6#l*;)<?@  &!4567'[*"$  $7 "rc8|jd|jS)Nz exited with )rrrHs rrqz#InstallationSubprocessError.__str__s**+=8HIIr) r0r1r2r3r7rSintr r rDrqrUrVs@rrrisP#.I#!# # tCy) #  #@JJrrc8eZdZdZdeddffd ZdefdZxZS)MetadataGenerationFailedzmetadata-generation-failedpackage_detailsrNcFtt| dt|ddy)Nz4Encountered error while generating package metadata.zSee above for details.rbr)rCrrDr)rFrrEs rrDz!MetadataGenerationFailed.__init__s+ )49J?+.S : rcy)Nzmetadata generation failedr4rHs rrqz MetadataGenerationFailed.__str__s+r)r0r1r2r7rSrDrqrUrVs@rrrs-,I       ,,rrc8eZdZdZddZd dZdefdZdefdZ y) HashErrorsz:Multiple HashError instances rolled into one for reportingrNcg|_yrz)errorsrHs rrDzHashErrors.__init__s )+ rc:|jj|yrz)rappend)rFr8s rrzHashErrors.appends 5!rc g}|jjdt|jdD]8\}}|j|j|j d|D:|rdj |Sy)Nc|jSrz)orderes rz$HashErrors.__str__..s qwwr)keyc|jSrzrVrs rrz$HashErrors.__str__..s rc3<K|]}|jywrz)body)r{rs rr}z%HashErrors.__str__..s9a9sr%rO)rsortrrheadextendr))rFlinescls errors_of_clss rrqzHashErrors.__str__sv ./")$++7L"M : C LL " LL9=9 9 : 99U# #rc,t|jSrz)boolrrHs r__bool__zHashErrors.__bool__sDKK  r)rN)r8 HashErrorrN) r0r1r2r3rDrrSrqrrr4rrrrs'D,"!$!rrc\eZdZUdZdZeded<dZdZe ed<de fd Z de fd Z de fd Z y) 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. NrreqrOr~rrc(d|jS)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().  )_requirement_namerHs rrzHashError.bodysd,,./00rc@|jd|jS)Nr%)rrrHs rrqzHashError.__str__s))Btyy{m,,rcH|jrt|jSdS)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!%s488}?.??r)r0r1r2r3rr rTrrrrSrrqrr4rrrrsM +/C& '. DE3O 1c 1--@3@rrceZdZdZdZdZy)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:Nr0r1r2r3rrr4rrrrs1 E ; rrceZdZdZdZdZy)DirectoryUrlHashUnsupportedrzUCan't verify hashes for these file:// requirements because they point to directories:Nrr4rrrrs1 E  rrc4eZdZdZdZdZdeddfdZdefdZy) 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||_y)zq :param gotten_hash: The hash of the (possibly malicious) archive we just downloaded N)r)rFrs rrDzHashMissing.__init__s 'rcddlm}d}|jrC|jjr|jjnt |jdd}dj |xsd||jS)Nr) FAVORITE_HASHrz {} --hash={}:{}r)pip._internal.utils.hashesrr is_direct original_linkgetattrformatr)rFrr_s rrzHashMissing.bodysn< 88 88%%&&TXXud3 %++  ((-9I9I  r) r0r1r2r3rrrSrDrr4rrrrs3< E  'C'D' c rrceZdZdZdZdZy) 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 rrc^eZdZdZdZdZdeeeefdeedfddfd Z defd Z defd Z y) 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 ||_||_y)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__Gs  rcJd|jd|jS)Nrz: )r_hash_comparisonrHs rrzHashMismatch.bodyQs)d,,./s43H3H3J2KLLrc*dtddfd}g}|jjD]W\}}|||jfd|D|j d|j |j dYdj|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_or`s)fX&67 7rc3@K|]}dtd|yw)z Expected  N)next)r{rr s rr}z0HashMismatch._hash_comparison..hs#Ua-d6l^1QC@Usz Got r%)rSritemsrrr hexdigestr))rFrrr expectedsr s @rrzHashMismatch._hash_comparisonTs 8C 8L 8 $(LL$6$6$8  Iy!),F LLU9U U LL*499Y+?+I+I+K*LBO   yyr) r0r1r2r3rrrrSr rDrrr4rrrr5sc E / S$s)^ 4Dg>##6 qvh''  (   '"&D 's(A1A A A1 A.+A1-A..A1configctjd} |j|d|d}|jD]1}t j t 5|||cdddcS |dS#1swYFxYw#t $rYtttjf$r6ddl m }tj|}tjd||YqwxYw) 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 112G>>@ -((2-ws|,-- -4y--  +\-F-FG K 8**73H NN.N J  Ks7AB  A=' B 3B =B B C'AC'&C')r0r1r2r3r7r rSrD staticmethodrr classmethodr pathlibPathr2rUrVs@rrrsy1I hsm  "#*gllC'( (rr)Pr3r r&rloggingr5rsys 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^rhrlrtrwrrrrrrrrrrrrrrrrrrrrrrr rrr4rrrDs  ,,GG9JJ*&7@   8 $ :c:d:) T3Y) )  )  )  )"yp'p'l--002(2 $6 " $6 "YY86/6C0C N,NO!2O( ;;B8BEHE#X#8","(M$M , .&J"46G&JR,: