zmc
2023-12-22 9fdbf60165db0400c2e8e6be2dc6e88138ac719a
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
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
U
G=®d‚lã@sæddlmZmZmZddlZddlZddlZddlZddlm    Z    m
Z
ddl m Z m Z mZGdd„deƒZGdd    „d    e
ejeƒƒZGd
d „d eƒZGd d „d eƒZdd„ZGdd„deƒZe d¡Zdd„Zdd„ZGdd„deƒZdS)é)Úabsolute_importÚdivisionÚprint_functionNé)Ú string_typesÚwith_metaclass)ÚVersionÚ LegacyVersionÚparsec@seZdZdZdS)ÚInvalidSpecifierzH
    An invalid specifier was found, users should refer to PEP 440.
    N)Ú__name__Ú
__module__Ú __qualname__Ú__doc__©rrúaD:\z\workplace\VsCode\pyvenv\venv\Lib\site-packages\pkg_resources/_vendor/packaging/specifiers.pyr sr c@s€eZdZejdd„ƒZejdd„ƒZejdd„ƒZejdd„ƒZej    d    d
„ƒZ
e
j d d
„ƒZ
ejdd d„ƒZ ejddd„ƒZ d S)Ú BaseSpecifiercCsdS)zŽ
        Returns the str representation of this Specifier like object. This
        should be representative of the Specifier itself.
        Nr©ÚselfrrrÚ__str__szBaseSpecifier.__str__cCsdS)zF
        Returns a hash value for this Specifier like object.
        NrrrrrÚ__hash__szBaseSpecifier.__hash__cCsdS)zq
        Returns a boolean representing whether or not the two Specifier like
        objects are equal.
        Nr©rÚotherrrrÚ__eq__#szBaseSpecifier.__eq__cCsdS)zu
        Returns a boolean representing whether or not the two Specifier like
        objects are not equal.
        NrrrrrÚ__ne__*szBaseSpecifier.__ne__cCsdS)zg
        Returns whether or not pre-releases as a whole are allowed by this
        specifier.
        NrrrrrÚ prereleases1szBaseSpecifier.prereleasescCsdS)zd
        Sets whether or not pre-releases as a whole are allowed by this
        specifier.
        Nr©rÚvaluerrrr8sNcCsdS)zR
        Determines if the given item is contained within this specifier.
        Nr©rÚitemrrrrÚcontains?szBaseSpecifier.containscCsdS)z•
        Takes an iterable of items and filters them so that only items which
        are contained within this specifier are allowed in it.
        Nr)rÚiterablerrrrÚfilterEszBaseSpecifier.filter)N)N)r r rÚabcÚabstractmethodrrrrÚabstractpropertyrÚsetterr r"rrrrrs 
 
 
 
 
 
 rc@s eZdZiZd dd„Zdd„Zdd„Zd    d
„Zd d „Zd d„Z    dd„Z
dd„Z e dd„ƒZ e dd„ƒZe dd„ƒZejdd„ƒZdd„Zd!dd„Zd"dd„ZdS)#Ú_IndividualSpecifierÚNcCsF|j |¡}|std |¡ƒ‚| d¡ ¡| d¡ ¡f|_||_dS)NzInvalid specifier: '{0}'ÚoperatorÚversion)Ú_regexÚsearchr ÚformatÚgroupÚstripÚ_specÚ _prereleases)rÚspecrÚmatchrrrÚ__init__Qs
 z_IndividualSpecifier.__init__cCs0|jdk    rd |j¡nd}d |jjt|ƒ|¡S)Nú, prereleases={0!r}r(z<{0}({1!r}{2})>)r1r-rÚ    __class__r Ústr©rÚprerrrÚ__repr__[s
ÿýz_IndividualSpecifier.__repr__cCs dj|jŽS)Nz{0}{1})r-r0rrrrrdsz_IndividualSpecifier.__str__cCs
t|jƒS©N)Úhashr0rrrrrgsz_IndividualSpecifier.__hash__cCsPt|tƒr4z| |¡}WqDtk
r0tYSXnt||jƒsDtS|j|jkSr;©Ú
isinstancerr6r ÚNotImplementedr0rrrrrjs
  z_IndividualSpecifier.__eq__cCsPt|tƒr4z| |¡}WqDtk
r0tYSXnt||jƒsDtS|j|jkSr;r=rrrrrus
  z_IndividualSpecifier.__ne__cCst|d |j|¡ƒS)Nz _compare_{0})Úgetattrr-Ú
_operators)rÚoprrrÚ _get_operator€sz"_IndividualSpecifier._get_operatorcCst|ttfƒst|ƒ}|Sr;)r>r    rr
©rr*rrrÚ_coerce_versionƒsz$_IndividualSpecifier._coerce_versioncCs
|jdS)Nr©r0rrrrr)ˆsz_IndividualSpecifier.operatorcCs
|jdS)NrrFrrrrr*Œsz_IndividualSpecifier.versioncCs|jSr;©r1rrrrrsz _IndividualSpecifier.prereleasescCs
||_dSr;rGrrrrr”scCs
| |¡Sr;©r ©rrrrrÚ __contains__˜sz!_IndividualSpecifier.__contains__cCs:|dkr|j}| |¡}|jr&|s&dS| |j¡||jƒS©NF)rrEÚ is_prereleaserCr)r*rrrrr ›s 
 
z_IndividualSpecifier.containsccs€d}g}d|dk    r|ndi}|D]B}| |¡}|j|f|Žr |jrX|sX|jsX| |¡q d}|Vq |s||r||D]
}|VqpdS)NFrT)rEr rLrÚappend)rr!rÚyieldedÚfound_prereleasesÚkwr*Úparsed_versionrrrr"®s"
ÿÿ z_IndividualSpecifier.filter)r(N)N)N)r r rrAr4r:rrrrrCrEÚpropertyr)r*rr&rJr r"rrrrr'Ms(
 
      
 
 
 
 
r'c@sveZdZdZe dedejejB¡Zdddddd    d
œZ    d d „Z
d d„Z dd„Z dd„Z dd„Zdd„Zdd„ZdS)ÚLegacySpecifieraÛ
        (?P<operator>(==|!=|<=|>=|<|>))
        \s*
        (?P<version>
            [^,;\s)]* # Since this is a "legacy" specifier, and the version
                      # string can be just about anything, we match everything
                      # except for whitespace, a semi-colon for marker support,
                      # a closing paren since versions can be enclosed in
                      # them, and a comma since it's a version separator.
        )
        ú^\s*ú\s*$ÚequalÚ    not_equalÚless_than_equalÚgreater_than_equalÚ    less_thanÚ greater_than)ú==ú!=ú<=ú>=ú<ú>cCst|tƒstt|ƒƒ}|Sr;)r>r    r7rDrrrrEès
 zLegacySpecifier._coerce_versioncCs|| |¡kSr;©rE©rÚ prospectiver2rrrÚ_compare_equalíszLegacySpecifier._compare_equalcCs|| |¡kSr;rbrcrrrÚ_compare_not_equalðsz"LegacySpecifier._compare_not_equalcCs|| |¡kSr;rbrcrrrÚ_compare_less_than_equalósz(LegacySpecifier._compare_less_than_equalcCs|| |¡kSr;rbrcrrrÚ_compare_greater_than_equalösz+LegacySpecifier._compare_greater_than_equalcCs|| |¡kSr;rbrcrrrÚ_compare_less_thanùsz"LegacySpecifier._compare_less_thancCs|| |¡kSr;rbrcrrrÚ_compare_greater_thanüsz%LegacySpecifier._compare_greater_thanN)r r rÚ
_regex_strÚreÚcompileÚVERBOSEÚ
IGNORECASEr+rArErerfrgrhrirjrrrrrSÏs  ú    rScst ˆ¡‡fdd„ƒ}|S)Ncst|tƒsdSˆ|||ƒSrK)r>rrc©ÚfnrrÚwrappeds
z)_require_version_compare.<locals>.wrapped)Ú    functoolsÚwraps)rqrrrrprÚ_require_version_comparesruc    @s¸eZdZdZe dedejejB¡Zdddddd    d
d d œZ    e
d d„ƒZ e
dd„ƒZ e
dd„ƒZ e
dd„ƒZe
dd„ƒZe
dd„ƒZe
dd„ƒZdd„Zedd„ƒZejdd„ƒZd S)!Ú    Specifiera
        (?P<operator>(~=|==|!=|<=|>=|<|>|===))
        (?P<version>
            (?:
                # The identity operators allow for an escape hatch that will
                # do an exact string match of the version you wish to install.
                # This will not be parsed by PEP 440 and we cannot determine
                # any semantic meaning from it. This operator is discouraged
                # but included entirely as an escape hatch.
                (?<====)  # Only match for the identity operator
                \s*
                [^\s]*    # We just match everything, except for whitespace
                          # since we are only testing for strict identity.
            )
            |
            (?:
                # The (non)equality operators allow for wild card and local
                # versions to be specified so we have to define these two
                # operators separately to enable that.
                (?<===|!=)            # Only match for equals and not equals
 
                \s*
                v?
                (?:[0-9]+!)?          # epoch
                [0-9]+(?:\.[0-9]+)*   # release
                (?:                   # pre release
                    [-_\.]?
                    (a|b|c|rc|alpha|beta|pre|preview)
                    [-_\.]?
                    [0-9]*
                )?
                (?:                   # post release
                    (?:-[0-9]+)|(?:[-_\.]?(post|rev|r)[-_\.]?[0-9]*)
                )?
 
                # You cannot use a wild card and a dev or local version
                # together so group them with a | and make them optional.
                (?:
                    (?:[-_\.]?dev[-_\.]?[0-9]*)?         # dev release
                    (?:\+[a-z0-9]+(?:[-_\.][a-z0-9]+)*)? # local
                    |
                    \.\*  # Wild card syntax of .*
                )?
            )
            |
            (?:
                # The compatible operator requires at least two digits in the
                # release segment.
                (?<=~=)               # Only match for the compatible operator
 
                \s*
                v?
                (?:[0-9]+!)?          # epoch
                [0-9]+(?:\.[0-9]+)+   # release  (We have a + instead of a *)
                (?:                   # pre release
                    [-_\.]?
                    (a|b|c|rc|alpha|beta|pre|preview)
                    [-_\.]?
                    [0-9]*
                )?
                (?:                                   # post release
                    (?:-[0-9]+)|(?:[-_\.]?(post|rev|r)[-_\.]?[0-9]*)
                )?
                (?:[-_\.]?dev[-_\.]?[0-9]*)?          # dev release
            )
            |
            (?:
                # All other operators only allow a sub set of what the
                # (non)equality operators do. Specifically they do not allow
                # local versions to be specified nor do they allow the prefix
                # matching wild cards.
                (?<!==|!=|~=)         # We have special cases for these
                                      # operators so we want to make sure they
                                      # don't match here.
 
                \s*
                v?
                (?:[0-9]+!)?          # epoch
                [0-9]+(?:\.[0-9]+)*   # release
                (?:                   # pre release
                    [-_\.]?
                    (a|b|c|rc|alpha|beta|pre|preview)
                    [-_\.]?
                    [0-9]*
                )?
                (?:                                   # post release
                    (?:-[0-9]+)|(?:[-_\.]?(post|rev|r)[-_\.]?[0-9]*)
                )?
                (?:[-_\.]?dev[-_\.]?[0-9]*)?          # dev release
            )
        )
        rTrUÚ
compatiblerVrWrXrYrZr[Ú    arbitrary)ú~=r\r]r^r_r`raú===cCsNd tt dd„t|ƒ¡ƒdd…¡}|d7}| d¡||ƒoL| d¡||ƒS)NÚ.cSs| d¡ o| d¡ S)NÚpostÚdev)Ú
startswith©ÚxrrrÚ<lambda>„óz/Specifier._compare_compatible.<locals>.<lambda>éÿÿÿÿú.*r_r\)ÚjoinÚlistÚ    itertoolsÚ    takewhileÚ_version_splitrC)rrdr2ÚprefixrrrÚ_compare_compatiblevs þÿûÿ
ÿzSpecifier._compare_compatiblecCsp| d¡rPt|jƒ}t|dd…ƒ}tt|ƒƒ}|dt|ƒ…}t||ƒ\}}nt|ƒ}|jsht|jƒ}||kS)Nr„éþÿÿÿ)ÚendswithrÚpublicr‰r7ÚlenÚ _pad_versionÚlocalrcrrrre‘s
 
 
zSpecifier._compare_equalcCs| ||¡ Sr;)rercrrrrf´szSpecifier._compare_not_equalcCs |t|ƒkSr;©rrcrrrrg¸sz"Specifier._compare_less_than_equalcCs |t|ƒkSr;r’rcrrrrh¼sz%Specifier._compare_greater_than_equalcCs<t|ƒ}||ksdS|js8|jr8t|jƒt|jƒkr8dSdS©NFT)rrLÚ base_versionrcrrrriÀs zSpecifier._compare_less_thancCs^t|ƒ}||ksdS|js8|jr8t|jƒt|jƒkr8dS|jdk    rZt|jƒt|jƒkrZdSdSr“)rÚis_postreleaser”r‘rcrrrrjÙs 
zSpecifier._compare_greater_thancCst|ƒ ¡t|ƒ ¡kSr;)r7ÚlowerrcrrrÚ_compare_arbitraryøszSpecifier._compare_arbitrarycCsR|jdk    r|jS|j\}}|dkrN|dkr@| d¡r@|dd…}t|ƒjrNdSdS)N)r\r_r^ryrzr\r„rŒTF)r1r0rr
rL)rr)r*rrrrûs
 
 
zSpecifier.prereleasescCs
||_dSr;rGrrrrrsN)r r rrkrlrmrnror+rArur‹rerfrgrhrirjr—rRrr&rrrrrv
s<]ø 
 
"
 
 
 
 
 
rvz^([0-9]+)((?:a|b|c|rc)[0-9]+)$cCs@g}| d¡D],}t |¡}|r0| | ¡¡q| |¡q|S)Nr{)ÚsplitÚ _prefix_regexr,ÚextendÚgroupsrM)r*Úresultrr3rrrr‰s
 r‰c
Csægg}}| tt dd„|¡ƒ¡| tt dd„|¡ƒ¡| |t|dƒd…¡| |t|dƒd…¡| ddgtdt|dƒt|dƒƒ¡| ddgtdt|dƒt|dƒƒ¡ttj|Žƒttj|ŽƒfS)NcSs| ¡Sr;©Úisdigitrrrrr*r‚z_pad_version.<locals>.<lambda>cSs| ¡Sr;rrrrrr+r‚rrÚ0)rMr†r‡rˆrÚinsertÚmaxÚchain)ÚleftÚrightÚ
left_splitÚ right_splitrrrr&s
,,rc@sŒeZdZddd„Zdd„Zdd„Zd    d
„Zd d „Zd d„Zdd„Z    dd„Z
dd„Z e dd„ƒZ e jdd„ƒZ dd„Zddd„Zd dd„ZdS)!Ú SpecifierSetr(Nc    Csndd„| d¡Dƒ}tƒ}|D]:}z| t|ƒ¡Wqtk
rV| t|ƒ¡YqXqt|ƒ|_||_dS)NcSsg|]}| ¡r| ¡‘qSr)r/©Ú.0ÚsrrrÚ
<listcomp><sz)SpecifierSet.__init__.<locals>.<listcomp>ú,)    r˜ÚsetÚaddrvr rSÚ    frozensetÚ_specsr1)rÚ
specifiersrÚparsedÚ    specifierrrrr49s
zSpecifierSet.__init__cCs*|jdk    rd |j¡nd}d t|ƒ|¡S)Nr5r(z<SpecifierSet({0!r}{1})>)r1r-rr7r8rrrr:Ns
ÿýzSpecifierSet.__repr__cCsd tdd„|jDƒƒ¡S)Nr¬css|]}t|ƒVqdSr;)r7r¨rrrÚ    <genexpr>Xsz'SpecifierSet.__str__.<locals>.<genexpr>)r…Úsortedr°rrrrrWszSpecifierSet.__str__cCs
t|jƒSr;)r<r°rrrrrZszSpecifierSet.__hash__cCs˜t|tƒrt|ƒ}nt|tƒs"tStƒ}t|j|jBƒ|_|jdkrX|jdk    rX|j|_n<|jdk    rv|jdkrv|j|_n|j|jkrŒ|j|_ntdƒ‚|S)NzFCannot combine SpecifierSets with True and False prerelease overrides.)r>rr§r?r¯r°r1Ú
ValueError)rrr³rrrÚ__and__]s 
 
 
 
 
 
ÿzSpecifierSet.__and__cCsFt|tƒrt|ƒ}n&t|tƒr,tt|ƒƒ}nt|tƒs:tS|j|jkSr;©r>rr§r'r7r?r°rrrrrts
 
 
 
zSpecifierSet.__eq__cCsFt|tƒrt|ƒ}n&t|tƒr,tt|ƒƒ}nt|tƒs:tS|j|jkSr;r¸rrrrr~s
 
 
 
zSpecifierSet.__ne__cCs
t|jƒSr;)rr°rrrrÚ__len__ˆszSpecifierSet.__len__cCs
t|jƒSr;)Úiterr°rrrrÚ__iter__‹szSpecifierSet.__iter__cCs.|jdk    r|jS|jsdStdd„|jDƒƒS)Ncss|] }|jVqdSr;©rr¨rrrr´sz+SpecifierSet.prereleases.<locals>.<genexpr>)r1r°ÚanyrrrrrŽs
 
zSpecifierSet.prereleasescCs
||_dSr;rGrrrrrŸscCs
| |¡Sr;rHrIrrrrJ£szSpecifierSet.__contains__csLtˆttfƒstˆƒ‰ˆdkr$|j‰ˆs2ˆjr2dSt‡‡fdd„|jDƒƒS)NFc3s|]}|jˆˆdVqdS)r¼NrHr¨©rrrrr´¾sz(SpecifierSet.contains.<locals>.<genexpr>)r>r    rr
rrLÚallr°rrr¾rr ¦s
zSpecifierSet.containscCs°|dkr|j}|jr6|jD]}|j|t|ƒd}q|Sg}g}|D]P}t|ttfƒs^t|ƒ}n|}t|tƒrnqB|jrˆ|sˆ|s’|     |¡qB|     |¡qB|s¨|r¨|dkr¨|S|SdS)Nr¼)
rr°r"Úboolr>r    rr
rLrM)rr!rr2ÚfilteredrOrrQrrrr"Às*
 
 
 
  zSpecifierSet.filter)r(N)N)N)r r rr4r:rrr·rrr¹r»rRrr&rJr r"rrrrr§8s 
    
 
 
 
 
r§)Ú
__future__rrrr#rsr‡rlÚ_compatrrr*rr    r
r¶r ÚABCMetaÚobjectrr'rSrurvrmr™r‰rr§rrrrÚ<module>s&81