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
257
U
H=®dÈ|ã@sXddlmZmZmZddlZddlZddlZddlZddlm    Z    m
Z
ddl m Z ddl mZddlmZmZmZe rÊddlmZmZmZmZmZmZmZmZmZeeefZeeeefZeeege fZ!Gd    d
„d
e"ƒZ#Gd d „d e
ej$e%ƒƒZ&Gd d„de&ƒZ'Gdd„de'ƒZ(dd„Z)Gdd„de'ƒZ*e +d¡Z,dd„Z-dd„Z.Gdd„de&ƒZ/dS)é)Úabsolute_importÚdivisionÚprint_functionNé)Ú string_typesÚwith_metaclass)Ú TYPE_CHECKING)Úcanonicalize_version)ÚVersionÚ LegacyVersionÚparse)    ÚListÚDictÚUnionÚIterableÚIteratorÚOptionalÚCallableÚTupleÚ    FrozenSetc@seZdZdZdS)ÚInvalidSpecifierzH
    An invalid specifier was found, users should refer to PEP 440.
    N)Ú__name__Ú
__module__Ú __qualname__Ú__doc__©rrúWD:\z\workplace\VsCode\pyvenv\venv\Lib\site-packages\pip/_vendor/packaging/specifiers.pyr"src@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__1szBaseSpecifier.__hash__cCsdS)zq
        Returns a boolean representing whether or not the two Specifier like
        objects are equal.
        Nr©rÚotherrrrÚ__eq__8szBaseSpecifier.__eq__cCsdS)zu
        Returns a boolean representing whether or not the two Specifier like
        objects are not equal.
        Nrr"rrrÚ__ne__@szBaseSpecifier.__ne__cCsdS)zg
        Returns whether or not pre-releases as a whole are allowed by this
        specifier.
        NrrrrrÚ prereleasesHszBaseSpecifier.prereleasescCsdS)zd
        Sets whether or not pre-releases as a whole are allowed by this
        specifier.
        Nr©rÚvaluerrrr&PsNcCsdS)zR
        Determines if the given item is contained within this specifier.
        Nr©rÚitemr&rrrÚcontainsXszBaseSpecifier.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Úiterabler&rrrÚfilter_szBaseSpecifier.filter)N)N)rrrÚabcÚabstractmethodr r!r$r%Úabstractpropertyr&Úsetterr+r-rrrrr(s 
 
 
 
 
 
 rc@s¬eZdZiZd"dd„Zdd„Zdd„Zed    d
„ƒZd d „Z    d d„Z
dd„Z dd„Z dd„Z edd„ƒZedd„ƒZedd„ƒZejdd„ƒZdd„Zd#dd„Zd$d d!„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__ls   þz_IndividualSpecifier.__init__cCs0|jdk    rd |j¡nd}d |jjt|ƒ|¡S)Nú, prereleases={0!r}r3z<{0}({1!r}{2})>)r<r8r&Ú    __class__rÚstr©rÚprerrrÚ__repr__zs
ÿýz_IndividualSpecifier.__repr__cCs dj|jŽS)Nz{0}{1})r8r;rrrrr „sz_IndividualSpecifier.__str__cCs|jdt|jdƒfS)Nrr)r;r    rrrrÚ_canonical_specˆsz$_IndividualSpecifier._canonical_speccCs
t|jƒS©N)ÚhashrFrrrrr!sz_IndividualSpecifier.__hash__cCsTt|tƒr8z| t|ƒ¡}WqHtk
r4tYSXnt||jƒsHtS|j|jkSrG)Ú
isinstancerrArBrÚNotImplementedrFr"rrrr$‘s
  z_IndividualSpecifier.__eq__cCsTt|tƒr8z| t|ƒ¡}WqHtk
r4tYSXnt||jƒsHtS|j|jkSrG)rIrrArBrrJr;r"rrrr%s
  z_IndividualSpecifier.__ne__cCst|d |j|¡ƒ}|S)Nz _compare_{0})Úgetattrr8Ú
_operators)rÚopÚoperator_callablerrrÚ _get_operator©s
ÿz"_IndividualSpecifier._get_operatorcCst|ttfƒst|ƒ}|SrG)rIr r
r ©rr5rrrÚ_coerce_version°sz$_IndividualSpecifier._coerce_versioncCs
|jdS)Nr©r;rrrrr4¶sz_IndividualSpecifier.operatorcCs
|jdS)NrrRrrrrr5»sz_IndividualSpecifier.versioncCs|jSrG©r<rrrrr&Àsz _IndividualSpecifier.prereleasescCs
||_dSrGrSr'rrrr&ÅscCs
| |¡SrG©r+©rr*rrrÚ __contains__Êsz!_IndividualSpecifier.__contains__cCs>|dkr|j}| |¡}|jr&|s&dS| |j¡}|||jƒS©NF)r&rQÚ is_prereleaserOr4r5)rr*r&Únormalized_itemrNrrrr+Î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)NFr&T)rQr+rXr&Úappend)rr,r&ÚyieldedÚfound_prereleasesÚkwr5Úparsed_versionrrrr-äs"
ÿÿ z_IndividualSpecifier.filter)r3N)N)N)rrrrLr?rEr ÚpropertyrFr!r$r%rOrQr4r5r&r1rVr+r-rrrrr2hs,
 
 
 
 
 
 
 
r2c@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|ƒƒ}|SrG)rIr rBrPrrrrQ s
 zLegacySpecifier._coerce_versioncCs|| |¡kSrG©rQ©rÚ prospectiver=rrrÚ_compare_equal&szLegacySpecifier._compare_equalcCs|| |¡kSrGrorprrrÚ_compare_not_equal*sz"LegacySpecifier._compare_not_equalcCs|| |¡kSrGrorprrrÚ_compare_less_than_equal.sz(LegacySpecifier._compare_less_than_equalcCs|| |¡kSrGrorprrrÚ_compare_greater_than_equal2sz+LegacySpecifier._compare_greater_than_equalcCs|| |¡kSrGrorprrrÚ_compare_less_than6sz"LegacySpecifier._compare_less_thancCs|| |¡kSrGrorprrrÚ_compare_greater_than:sz%LegacySpecifier._compare_greater_thanN)rrrÚ
_regex_strÚreÚcompileÚVERBOSEÚ
IGNORECASEr6rLrQrrrsrtrurvrwrrrrr`s  ú    r`cst ˆ¡‡fdd„ƒ}|S)Ncst|tƒsdSˆ|||ƒSrW)rIr
rp©ÚfnrrÚwrappedCs
z)_require_version_compare.<locals>.wrapped)Ú    functoolsÚwraps)r~rrr}rÚ_require_version_compare?sr‚c    @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
            )
        )
        rarbÚ
compatiblercrdrerfrgrhÚ    arbitrary)ú~=rirjrkrlrmrnú===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>éÿÿÿÿú.*rlri)ÚjoinÚlistÚ    itertoolsÚ    takewhileÚ_version_splitrO)rrqr=ÚprefixrrrÚ_compare_compatible¹s þÿûÿ
ÿzSpecifier._compare_compatiblec    Csz| d¡rVt|jƒ}t|dd…ƒ}tt|ƒƒ}|dt|ƒ…}t||ƒ\}}||kSt|ƒ}|jsnt|jƒ}||kSdS)Nr‘éþÿÿÿ)Úendswithr
Úpublicr–rBÚlenÚ _pad_versionÚlocal)    rrqr=Ú
split_specÚsplit_prospectiveÚshortened_prospectiveÚ padded_specÚpadded_prospectiveÚ spec_versionrrrrrÖs
 
 ÿ
zSpecifier._compare_equalcCs| ||¡ SrG)rrrprrrrsÿszSpecifier._compare_not_equalcCst|jƒt|ƒkSrG©r
r›rprrrrtsz"Specifier._compare_less_than_equalcCst|jƒt|ƒkSrGr¥rprrrru sz%Specifier._compare_greater_than_equalcCs<t|ƒ}||ksdS|js8|jr8t|jƒt|jƒkr8dSdS©NFT)r
rXÚ base_version©rrqÚspec_strr=rrrrvs zSpecifier._compare_less_thancCs^t|ƒ}||ksdS|js8|jr8t|jƒt|jƒkr8dS|jdk    rZt|jƒt|jƒkrZdSdSr¦)r
Úis_postreleaser§ržr¨rrrrw1s 
zSpecifier._compare_greater_thancCst|ƒ ¡t|ƒ ¡kSrG)rBÚlowerrprrrÚ_compare_arbitraryRszSpecifier._compare_arbitrarycCsR|jdk    r|jS|j\}}|dkrN|dkr@| d¡r@|dd…}t|ƒjrNdSdS)N)rirlrkr†r‡rir‘r™TF)r<r;ršr rX)rr4r5rrrr&Vs
 
 
zSpecifier.prereleasescCs
||_dSrGrSr'rrrr&psN)rrrrxryrzr{r|r6rLr‚r˜rrrsrtrurvrwr¬r_r&r1rrrrrƒMs<]ø 
 
(
 
 
 
 
 
rƒz^([0-9]+)((?:a|b|c|rc)[0-9]+)$cCs@g}| d¡D],}t |¡}|r0| | ¡¡q| |¡q|S)Nrˆ)ÚsplitÚ _prefix_regexr7ÚextendÚgroupsrZ)r5Úresultr*r>rrrr–ys
 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| ¡SrG©ÚisdigitrŒrrrrŽŠrz_pad_version.<locals>.<lambda>cSs| ¡SrGr²rŒrrrrŽ‹rrrÚ0)rZr“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)!Ú SpecifierSetr3Nc    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Úaddrƒrr`Ú    frozensetÚ_specsr<)rÚ
specifiersr&Úsplit_specifiersÚparsedÚ    specifierrrrr?™s
zSpecifierSet.__init__cCs*|jdk    rd |j¡nd}d t|ƒ|¡S)Nr@r3z<SpecifierSet({0!r}{1})>)r<r8r&rBrCrrrrE°s
ÿýzSpecifierSet.__repr__cCsd tdd„|jDƒƒ¡S)NrÁcss|]}t|ƒVqdSrG)rBr½rrrÚ    <genexpr>¼sz'SpecifierSet.__str__.<locals>.<genexpr>)r’ÚsortedrÅrrrrr ºszSpecifierSet.__str__cCs
t|jƒSrG)rHrÅrrrrr!¾szSpecifierSet.__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.)rIrr¼rJrÄrÅr<Ú
ValueError)rr#rÉrrrÚ__and__Âs 
 
 
 
 
 
ÿzSpecifierSet.__and__cCs6t|ttfƒrtt|ƒƒ}nt|tƒs*tS|j|jkSrG©rIrr2r¼rBrJrÅr"rrrr$Ús
 
zSpecifierSet.__eq__cCs6t|ttfƒrtt|ƒƒ}nt|tƒs*tS|j|jkSrGrÎr"rrrr%ãs
 
zSpecifierSet.__ne__cCs
t|jƒSrG)rœrÅrrrrÚ__len__ìszSpecifierSet.__len__cCs
t|jƒSrG)ÚiterrÅrrrrÚ__iter__ðszSpecifierSet.__iter__cCs.|jdk    r|jS|jsdStdd„|jDƒƒS)Ncss|] }|jVqdSrG©r&r½rrrrÊsz+SpecifierSet.prereleases.<locals>.<genexpr>)r<rÅÚanyrrrrr&ôs
 
zSpecifierSet.prereleasescCs
||_dSrGrSr'rrrr&scCs
| |¡SrGrTrUrrrrV szSpecifierSet.__contains__csLtˆttfƒstˆƒ‰ˆdkr$|j‰ˆs2ˆjr2dSt‡‡fdd„|jDƒƒS)NFc3s|]}|jˆˆdVqdS)rÒNrTr½©r*r&rrrÊ*sz(SpecifierSet.contains.<locals>.<genexpr>)rIr r
r r&rXÚallrÅr)rrÔ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Ò)
r&rÅr-ÚboolrIr r
r rXrZ)rr,r&r=Úfilteredr\r*r^rrrr-,s*
 
 
 
 
  zSpecifierSet.filter)r3N)N)N)rrrr?rEr r!rÍr$r%rÏrÑr_r&r1rVr+r-rrrrr¼˜s"
 
        
 
 
ýr¼)0Ú
__future__rrrr.r€r”ryÚ_compatrrÚ_typingrÚutilsr    r5r
r r Útypingr rrrrrrrrZ ParsedVersionrBZUnparsedVersionrÖZCallableOperatorrÌrÚABCMetaÚobjectrr2r`r‚rƒrzr®r–rr¼rrrrÚ<module>s4  , @ 8+