zmc
2023-08-08 e792e9a60d958b93aef96050644f369feb25d61b
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
U
H=®d]1ã@sNdZddlmZddlmZmZmZddlmZddl    m
Z
e
rºddl m Z m Z mZmZmZddlmZddlmZmZdd    lmZdd
lmZdd lmZer®dd lmZn dd lmZGdd„deƒZGdd„deƒZ Gdd„deƒZ!Gdd„deƒZ"Gdd„deƒZ#Gdd„de!ƒZ$Gdd„de!ƒZ%Gdd„deƒZ&Gdd„deƒZ'Gd d!„d!eƒZ(Gd"d#„d#eƒZ)Gd$d%„d%eƒZ*Gd&d'„d'eƒZ+Gd(d)„d)e!ƒZ,Gd*d+„d+e!ƒZ-Gd,d-„d-e!ƒZ.Gd.d/„d/e!ƒZ/Gd0d1„d1e!ƒZ0Gd2d3„d3e0ƒZ1Gd4d5„d5e0ƒZ2Gd6d7„d7e0ƒZ3Gd8d9„d9e0ƒZ4Gd:d;„d;e0ƒZ5Gd<d=„d=e!ƒZ6Gd>d?„d?e ƒZ7d@S)Az"Exceptions used throughout packageé)Úabsolute_import)ÚchainÚgroupbyÚrepeat)Ú    iteritems)ÚMYPY_CHECK_RUNNING)ÚAnyÚOptionalÚListÚDictÚText)Ú Distribution)ÚResponseÚRequest)ÚPY3)Ú configparser)ÚInstallRequirement)Ú_Hash)Ú_hashc@seZdZdZdS)ÚPipErrorzBase pip exceptionN©Ú__name__Ú
__module__Ú __qualname__Ú__doc__©rrúOD:\z\workplace\VsCode\pyvenv\venv\Lib\site-packages\pip/_internal/exceptions.pyrsrc@seZdZdZdS)ÚConfigurationErrorz"General exception in configurationNrrrrrrsrc@seZdZdZdS)ÚInstallationErrorz%General exception during installationNrrrrrr#src@seZdZdZdS)ÚUninstallationErrorz'General exception during uninstallationNrrrrrr'src@s eZdZdZdd„Zdd„ZdS)ÚNoneMetadataErrora
    Raised when accessing "METADATA" or "PKG-INFO" metadata for a
    pip._vendor.pkg_resources.Distribution object and
    `dist.has_metadata('METADATA')` returns True but
    `dist.get_metadata('METADATA')` returns None (and similarly for
    "PKG-INFO").
    cCs||_||_dS)zª
        :param dist: A Distribution object.
        :param metadata_name: The name of the metadata being accessed
            (can be "METADATA" or "PKG-INFO").
        N)ÚdistÚ metadata_name)Úselfr!r"rrrÚ__init__4szNoneMetadataError.__init__cCsd |j|j¡S)Nz+None {} metadata found for distribution: {})Úformatr"r!©r#rrrÚ__str__>s
ÿÿzNoneMetadataError.__str__N©rrrrr$r'rrrrr +s
r c@seZdZdZdS)ÚDistributionNotFoundzCRaised when a distribution cannot be found to satisfy a requirementNrrrrrr)Isr)c@seZdZdZdS)ÚRequirementsFileParseErrorzDRaised when a general error occurs parsing a requirements file line.Nrrrrrr*Msr*c@seZdZdZdS)ÚBestVersionAlreadyInstalledzNRaised when the most up-to-date version of a package is already
    installed.Nrrrrrr+Qsr+c@seZdZdZdS)Ú
BadCommandz0Raised when virtualenv or a command is not foundNrrrrrr,Vsr,c@seZdZdZdS)Ú CommandErrorz7Raised when there is an error in command-line argumentsNrrrrrr-Zsr-c@seZdZdZdS)ÚSubProcessErrorzPRaised when there is an error raised while executing a
    command in subprocessNrrrrrr.^sr.c@seZdZdZdS)ÚPreviousBuildDirErrorz:Raised when there's a previous conflicting build directoryNrrrrrr/csr/cs*eZdZdZd‡fdd„    Zdd„Z‡ZS)ÚNetworkConnectionErrorzHTTP connection errorNcsN||_||_||_|jdk    r6|js6t|dƒr6|jj|_tt|ƒ |||¡dS)zc
        Initialize NetworkConnectionError with  `request` and `response`
        objects.
        NÚrequest)Úresponser1Ú    error_msgÚhasattrÚsuperr0r$)r#r3r2r1©Ú    __class__rrr$jsÿ
 
ÿzNetworkConnectionError.__init__cCs
t|jƒS©N)Ústrr3r&rrrr'yszNetworkConnectionError.__str__)NN©rrrrr$r'Ú __classcell__rrr6rr0gsr0c@seZdZdZdS)ÚInvalidWheelFilenamezInvalid wheel filename.Nrrrrrr<~sr<c@seZdZdZdS)ÚUnsupportedWheelzUnsupported wheel.Nrrrrrr=‚sr=c@s eZdZdZdd„Zdd„ZdS)ÚMetadataInconsistentzøBuilt 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
    or user-supplied ``#egg=`` value.
    cCs||_||_||_dSr8)ÚireqÚfieldÚbuilt)r#r?r@rArrrr$szMetadataInconsistent.__init__cCsd |j|j|j¡S)Nz/Requested {} has different {} in metadata: {!r})r%r?r@rAr&rrrr'“s
ÿzMetadataInconsistent.__str__Nr(rrrrr>†sr>c@s8eZdZdZdd„Zdd„Zdd„Zdd    „Zd
d „Zd S) Ú
HashErrorsz:Multiple HashError instances rolled into one for reportingcCs
g|_dSr8)Úerrorsr&rrrr$szHashErrors.__init__cCs|j |¡dSr8)rCÚappend)r#ÚerrorrrrrD¡szHashErrors.appendcCsbg}|jjdd„dt|jdd„ƒD](\}}| |j¡| dd„|Dƒ¡q&|r^d |¡SdS)    NcSs|jSr8)Úorder©ÚerrrÚ<lambda>¨óz$HashErrors.__str__.<locals>.<lambda>)ÚkeycSs|jSr8r6rGrrrrI©rJcss|]}| ¡VqdSr8)Úbody©Ú.0rHrrrÚ    <genexpr>«sz%HashErrors.__str__.<locals>.<genexpr>Ú
Ú)rCÚsortrrDÚheadÚextendÚjoin)r#ÚlinesÚclsÚ errors_of_clsrrrr'¥s 
zHashErrors.__str__cCs
t|jƒSr8)ÚboolrCr&rrrÚ __nonzero__°szHashErrors.__nonzero__cCs| ¡Sr8)rZr&rrrÚ__bool__´szHashErrors.__bool__N)    rrrrr$rDr'rZr[rrrrrBšs  rBc@s4eZdZdZdZdZdZdd„Zdd„Zdd    „Z    dS)
Ú    HashErrora”
    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.
 
    NrQcCsd | ¡¡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    {})r%Ú_requirement_namer&rrrrLÍs zHashError.bodycCsd |j| ¡¡S)Nz{}
{})r%rSrLr&rrrr'ÚszHashError.__str__cCs|jrt|jƒSdS)z¨Return a description of the requirement that triggered me.
 
        This default implementation returns long description of the req, with
        line numbers
 
        úunknown package)Úreqr9r&rrrr]ÞszHashError._requirement_name)
rrrrr_rSrFrLr'r]rrrrr\¹s r\c@seZdZdZdZdZdS)ÚVcsHashUnsupportedúuA 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:N©rrrrrFrSrrrrr`ésr`c@seZdZdZdZdZdS)ÚDirectoryUrlHashUnsupportedraézUCan't verify hashes for these file:// requirements because they point to directories:Nrbrrrrrcòsrcc@s(eZdZdZdZdZdd„Zdd„ZdS)    Ú 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.)cCs
||_dS)zq
        :param gotten_hash: The hash of the (possibly malicious) archive we
            just downloaded
        N)Ú gotten_hash)r#rgrrrr$szHashMissing.__init__cCsHddlm}d}|jr4|jjr&|jjn t|jddƒ}d |p>d||j¡S)Nr)Ú FAVORITE_HASHr_z    {} --hash={}:{}r^)Úpip._internal.utils.hashesrhr_Ú original_linkÚgetattrr%rg)r#rhÚpackagerrrrLs  ý
þzHashMissing.bodyN)rrrrrFrSr$rLrrrrreûs
rec@seZdZdZdZdZdS)Ú 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:Nrbrrrrrm"srmc@s0eZdZdZdZdZdd„Zdd„Zdd    „Zd
S) Ú 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.
 
    ézÞTHESE 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.cCs||_||_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)ÚallowedÚgots)r#rqrrrrrr$:szHashMismatch.__init__cCsd | ¡| ¡¡S)Nz
    {}:
{})r%r]Ú_hash_comparisonr&rrrrLEs
ÿzHashMismatch.bodycsddd„}g}t|jƒD]B\}}||ƒ‰| ‡fdd„|Dƒ¡| d |j| ¡¡¡qd |¡S)aE
        Return a comparison of actual and expected hash values.
 
        Example::
 
               Expected sha256 abcdeabcdeabcdeabcdeabcdeabcdeabcdeabcdeabcde
                            or 123451234512345123451234512345123451234512345
                    Got        bcdefbcdefbcdefbcdefbcdefbcdefbcdefbcdefbcdef
 
        cSst|gtdƒƒS)Nz    or)rr)Ú    hash_namerrrÚ hash_then_orVsz3HashMismatch._hash_comparison.<locals>.hash_then_orc3s|]}d tˆƒ|¡VqdS)z        Expected {} {}N)r%ÚnextrM©ÚprefixrrrO_sÿz0HashMismatch._hash_comparison.<locals>.<genexpr>z             Got        {}
rP)rrqrTrDr%rrÚ    hexdigestrU)r#rurVrtÚ    expectedsrrwrrsJs ÿ ÿzHashMismatch._hash_comparisonN)    rrrrrFrSr$rLrsrrrrro+s  roc@seZdZdZdS)ÚUnsupportedPythonVersionzMUnsupported python version according to Requires-Python package
    metadata.Nrrrrrr{fsr{cs*eZdZdZd‡fdd„    Zdd„Z‡ZS)    Ú!ConfigurationFileCouldNotBeLoadedz=When there are errors while loading a configuration file
    úcould not be loadedNcs&tt|ƒ |¡||_||_||_dSr8)r5r|r$ÚreasonÚfnamerE)r#r~rrEr6rrr$osz*ConfigurationFileCouldNotBeLoaded.__init__cCs@|jdk    rd |j¡}n|jdk    s&t‚d |j¡}d |j|¡S)Nz in {}.z.
{}
zConfiguration file {}{})rr%rEÚAssertionErrorr~)r#Ú message_partrrrr'vs
 
 z)ConfigurationFileCouldNotBeLoaded.__str__)r}NNr:rrr6rr|ksr|N)8rÚ
__future__rÚ    itertoolsrrrZpip._vendor.sixrÚpip._internal.utils.typingrÚtypingrr    r
r r Zpip._vendor.pkg_resourcesr Zpip._vendor.requests.modelsrrrÚpip._vendor.six.movesrZpip._internal.req.req_installrÚhashlibrrÚ    Exceptionrrrrr r)r*r+r,r-r.r/r0r<r=r>rBr\r`rcrermror{r|rrrrÚ<module>sN        0        '    ;