hyb
2025-11-18 7539e6f48c75dcaeb808359cccfd1c0d0d182ce8
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
Ë
ñúhGã
óð—dZddlmZddlZddlZddlZddlZddlmZddl    m
Z
ddl m Z ddl mZmZddlmZdd    lmZdd
lmZmZdd lmZdd lmZdd lmZddlmZddlm Z ddl!m"Z"ddl#m$Z$ddl%m&Z&ddl'm(Z(m)Z)gd¢Z*ejVe,«Z-ej\j_«Z0d-d„Z1d.d„Z2d/d„Z3d0d„Z4d1d„Z5d2d„Z6e
d¬«Gd„d««Z7d3d„Z8    d4dd ddd d d dd!œ                                                                                    d5d"„Z9d6d#„Z:d7d$„Z;d8d%„Z<    d4dd ddd dd dd&œ                                                                                    d9d'„Z=                d:                                            d;d(„Z>                d<                                            d=d)„Z?                        d>d*„Z@d?d+„ZA                        d@d,„ZBy)Aa~Backing implementation for InstallRequirement's various constructors
 
The idea here is that these formed a major chunk of InstallRequirement's size
so, moving them and support code dedicated to them outside of that class
helps creates for better understandability for the rest of the code.
 
These are meant to be used elsewhere within pip to create instances of
InstallRequirement.
é)Ú annotationsN)Ú
Collection)Ú    dataclass)ÚMarker)ÚInvalidRequirementÚ Requirement)Ú    Specifier)ÚInstallationError)ÚPyPIÚTestPyPI)ÚLink)ÚWheel)ÚParsedRequirement)ÚInstallRequirement)Úis_archive_file)Úis_installable_dir)Úget_requirement)Ú path_to_url)Úis_urlÚvcs)Úinstall_req_from_editableÚinstall_req_from_lineÚparse_editablecóŽ—tjd|«}d}|r&|jd«}|jd«}||fS|}||fS)Nz^(.+)(\[[^\]]+\])$éé)ÚreÚmatchÚgroup)ÚpathÚmÚextrasÚpath_no_extrass    úQH:\Change_password\venv_build\Lib\site-packages\pip/_internal/req/constructors.pyÚ _strip_extrasr%.sT€Ü
‰Ð&¨Ó-€AØ €FÙØŸ™ ›ˆØ—‘˜“ˆð ˜6Ð !Ð!ðˆà ˜6Ð !Ð!ócóf—|s
t«Std|j«z«jS)NÚ placeholder)ÚsetrÚlowerr")r"s r$Úconvert_extrasr+:s(€Ù Ü‹uˆ Ü ˜=¨6¯<©<«>Ñ9Ó :× AÑ AÐAr&cóX—tjdt|«tj¬«}|€ Jd|›d«‚|j    d«}|j    d«}||€ Jd|›d«‚dj |rd    j t|««nd
«}t|›|›|›«S) zÅ
    Returns a new requirement based on the given one, with the supplied extras. If the
    given requirement already has extras those are replaced (or dropped if no new extras
    are given).
    z([\w\t .-]+)(\[[^\]]*\])?(.*))Úflagszregex match on requirement z! failed, this should never happenréz&regex group selection for requirement z[{}]ú,Ú)    rÚ    fullmatchÚstrÚASCIIrÚformatÚjoinÚsortedr)ÚreqÚ
new_extrasrÚpreÚpostr"s      r$Ú_set_requirement_extrasr;@sÀ€ô #%§,¡,à(Ü ˆC‹Üh‰hô    #€Eð    ÐðLà    $ S EÐ)JÐKóLØà—k‘k !“n€CØ—{‘{ 1“~€Dà ˆ˜DÐ,ðWà    /°¨uÐ4UÐVóWØ,à—-‘-Á
 §¡¬°
Ó);Ô <ÐPRÓS€FÜ ˜c˜U 6 (¨4¨&Ð1Ó 2Ð2r&cóœ—|}t|«\}}tjj|«r t    |«}|j «j d«rMt|«j}|r)||td|j «z«jfS||t«fStD]-}|j «j |›d«sŒ&|›d|›}nt|«}|js0djtj«}t!|›d|›d«‚|j}|st!d|›d    «‚||t«fS)
aParses an editable requirement into:
        - a requirement name
        - an URL
        - extras
        - editable options
    Accepted requirements:
        svn+http://blahblah@rev#egg=Foobar[baz]&subdirectory=version_subdir
        .[some_extra]
    zfile:r(ú:ú+z, zq is not a valid editable requirement. It should either be a path to a local project or a VCS URL (beginning with z).z'Could not detect requirement name for 'z1', please specify one with #egg=your_package_name)r%Úosr Úisdirrr*Ú
startswithr Ú egg_fragmentrr"r)rÚis_vcsr5Ú all_schemesr
)Ú editable_reqÚurlÚ url_no_extrasr"Ú package_nameÚversion_controlÚlinkÚbackendss        r$rrYs^€ð €Cô*¨#Ó.Ñ€M6ä    ‡ww‡}}]Ô#ä# MÓ2ˆ à×ÑÓ×'Ñ'¨Ô0ܘMÓ*×7Ñ7ˆ Ù àØÜ  °· ± ³Ñ >Ó?×FÑFðð ð   ´³Ð5Ð 5äòˆØ 9‰9‹;× !Ñ ! _Ð$5°QÐ"7Õ 8Ø$Ð% Q s eÐ,ˆCÙ ðô
‹9€Dà ;Š;Ø—9‘9œSŸ_™_Ó-ˆÜ؈nðà'˜j¨ð ,ó
ð    
ð ×$Ñ$€LÙ ÜØ5°l°^ðD=ð =ó
ð    
𠘜c›eÐ #Ð#r&có4—t|dd¬«5}d„d„|D«D«}|D]_}d|vr|d|jd«}|jd«r |dd    j«t    |d
«z}t |«ddd«y    ddd«y#1swYyxYw) a Check if file is parsable as a requirements file.
 
    This is heavily based on ``pkg_resources.parse_requirements``, but
    simplified to just check the first meaningful line.
 
    :raises InvalidRequirement: If the first meaningful line cannot be parsed
        as an requirement.
    zutf-8Úignore)ÚencodingÚerrorsc3óFK—|]}|r|jd«s|–—Œy­w)ú#N)rA©Ú.0Úlines  r$ú    <genexpr>z2check_first_requirement_in_file.<locals>.<genexpr>›s&èø€ò
àÙ˜DŸO™O¨CÔ0ô ñ
ùs‚!c3ó<K—|]}|j«–—Œy­w©N)ÚstriprRs  r$rUz2check_first_requirement_in_file.<locals>.<genexpr>sèø€Ò4¨$˜Ÿ™ŸÑ4ùs‚z #Nú\éþÿÿÿr0)ÚopenÚfindÚendswithrXÚnextr)ÚfilenameÚfÚlinesrTs    r$Úcheck_first_requirement_in_filerbs¦€ô
ˆh °Ô    :ð¸añ
á4°!Ô4ô
ˆð ò    ˆDàt‰|ØÐ-˜dŸi™i¨›oÐ.à}‰}˜TÔ"ؘC˜Ry—‘Ó(¬4°°r«?Ñ:Ü ˜DÔ !Ø ÷!ðñ    ÷÷ñúsA+BÂBÂBcóʗtjj|«sd|›dSd}    t|«|d|›dz }|S#t$rt
j d|«Y|SwxYw)z„Returns helpful msg in case requirements file does not exist,
    or cannot be parsed.
 
    :params req: Requirements file path
    z File 'z' does not exist.z The path does exist. zThe argument you provided (zx) appears to be a requirements file. If that is the case, use the '-r' flag to install the packages specified within it.z&Cannot parse '%s' as requirements file)r?r ÚexistsrbrÚloggerÚdebug)r7Úmsgs  r$Údeduce_helpful_msgrh¬s†€ô 7‰7>‰>˜#Ô Ø˜˜Ð.Ð/Ð/Ø
"€Cð 
Ü'¨Ô,ð     ð؈uð1ð 2ñ    
ˆð €Jøô òD܏ ‰ Ð=¸sÕCð €JðDús© ?¿A"Á!A"T)Úfrozencó6—eZdZUded<ded<ded<ded<y    )
ÚRequirementPartszRequirement | NoneÚ requirementz Link | NonerJz Marker | NoneÚmarkersúset[str]r"N)Ú__name__Ú
__module__Ú __qualname__Ú__annotations__©r&r$rkrkÅs…à#Ó#Ø
ÓØ ÓØ Ôr&rkcó¸—t|«\}}}|     t|«}nd}t    |«}t ||d|«S#t$r}td|›d|›«‚d}~wwxYw)NúInvalid requirement: ú: )rrrr
r rk)rEÚnamerFÚextras_overrider7ÚexcrJs       r$Úparse_req_from_editablerzÍsw€Ü!/° Ó!=Ñ€Dˆ#ˆà Ðð    MÜ&5°dÓ&;‰Cðˆä ‹9€Dä ˜C  t¨_Ó =Ð=øô"ò    MÜ#Ð&;¸D¸8À2ÀcÀUÐ$KÓLÐ Lûð    Mús“ :º    AÁAÁAF)Ú
use_pep517ÚisolatedÚglobal_optionsÚ hash_optionsÚ
constraintÚ user_suppliedÚpermit_editable_wheelsÚconfig_settingscó„—t|«}
t|
j||d||
j||||||    |
j¬« S)NT) Ú
comes_fromr€ÚeditablerrJrr{r|r}r~r‚r")rzrrlrJr") rEr„r{r|r}r~rr€rr‚Úpartss            r$rràsP€ô $ LÓ 1€Eä Ø ×ÑØØ#ØØ5Ø Z‰ZØØØØ%Ø!Ø'؏|‰|ô ðr&cóЗtjj|vrytjjtjj|vry|j    d«ryy)akChecks whether the string "looks like" a path on the filesystem.
 
    This does not check whether the target actually exists, only judge from the
    appearance.
 
    Returns true if any of the following conditions is true:
    * a path separator is found (either os.path.sep or os.path.altsep);
    * a dot is found (which represents the current directory).
    Tú.F)r?r ÚsepÚaltseprA)rws r$Ú_looks_like_pathr‹sI€ô
‡ww‡{{dÑØÜ    ‡ww‡~~Ð!¤b§g¡g§n¡n¸Ñ&<ØØ ‡sÔØØ r&có¬—t|«rDtjj|«r%t    |«r t |«St d|›d«‚t|«sytjj|«r t |«S|jdd«}t|«dk\rt|d«sytjd|«t |«S)    aK
    First, it checks whether a provided path is an installable directory. If it
    is, returns the path.
 
    If false, check if the path is an archive file (such as a .whl).
    The function checks if the path is a file. If false, if the path has
    an @, it will treat it as a PEP 440 URL requirement and return the path.
    z
Directory zC is not installable. Neither 'setup.py' nor 'pyproject.toml' found.Nú@rrrzARequirement %r looks like a filename, but the file does not exist) r‹r?r r@rrr
rÚisfileÚsplitÚlenreÚwarning)r rwÚ urlreq_partss   r$Ú_get_url_from_pathr“sÀô˜Ô¤"§'¡'§-¡-°Ô"5Ü ˜dÔ #ܘtÓ$Ð $ô Ø˜˜ð!*ð *ó
ð    
ô ˜4Ô  ØÜ    ‡ww‡~~dÔܘ4ӠРؗ:‘:˜c 1Ó%€LÜ
ˆ<Ó˜AÒÔ&6°|ÀA±Ô&GðÜ
‡NNØKØ ôô tÓ Ðr&c    ó̇‡—t|«rd}nd}||vr6|j|d«\}}|j«}|sd}nt|«}nd}|j«}d}tj
j tj
j|««}d}d}t|«r t|«}n't|«\}    }t|    |«}
|
 t|
«}|rÑ|jdk(rxtjd|j«rXtttj
j tj
j|j
««««}|j r1t#|j$«} | j&›d| j(›}n|j*}n|}t-|«} d    ˆfd„ Šd
ˆfd„ } |    | |«}nd}t/|||| «S) Nz; ú;rÚfilez\.\./z==có•—‰s|S|›d‰›dS)Nz (from ú)rs)ÚtextÚ line_sources €r$Ú with_sourcez(parse_req_from_line.<locals>.with_sourceesø€Ù؈Kؐw˜{˜m¨1Ð-Ð-r&có"•‡—    t‰«S#t$rv}tjj‰vrd}|t ‰«z }n!d‰vrt ˆfd„tD««sd}nd}‰d‰›d|›«}|r|d|›z }t|«‚d}~wwxYw)    NzIt looks like a path.ú=c3ó&•K—|]}|‰v–—Œ
y­wrWrs)rSÚopÚ req_as_strings  €r$rUzAparse_req_from_line.<locals>._parse_req_string.<locals>.<genexpr>qsøèø€ò2Ø(*mÔ#ñ2ùsƒz,= is not a valid operator. Did you mean == ?r0rurvz
Hint: )    rrr?r r‰rhÚanyÚ    operatorsr
)r ryÚadd_msgrgr›s`   €r$Ú_parse_req_stringz.parse_req_from_line.<locals>._parse_req_stringjs©ù€ð    )Ü" =Ó1Ð 1øÜ!ò     )܏w‰w{‰{˜mÑ+Ø1ØÔ-¨mÓ<Ñ<‘ؘ Ñ%¬có2Ü.7ô2ô/ðI‘àÙР5°mÐ5FÀbÈÈÐNÓOˆCÙØ˜ ' Ð+Ñ+Ü# CÓ(Ð (ûð     )ús„
    B˜A1B        B)r™r2Úreturnr2)r r2r¥r)rrrXrr?r ÚnormpathÚabspathr r%r“ÚschemerÚsearchrFrÚis_wheelrr_rwÚversionrBr+rk)rwršÚ
marker_sepÚmarkers_as_stringrmr r rJÚextras_as_stringÚprFÚwheelr"r¤r7r›s `             @r$Úparse_req_from_liner±5sžù€Ü ˆd„|؉
àˆ
ؐTÑØ"&§*¡*¨Z¸Ó";ÑˆÐØ-×3Ñ3Ó5Ð٠؉GäÐ.Ó/‰GàˆØ :‰:‹<€DØ€MÜ 7‰7× Ñ œBŸG™GŸO™O¨DÓ1Ó 2€DØ €DØÐä ˆd„|ܐD‹z‰ä+¨DÓ1шРܠ  DÓ)ˆØ ˆ?ܘ“9ˆDñ à ;‰;˜&Ò  ¤R§Y¡Y¨x¸¿¹Ô%BÜœ ¤B§G¡G×$4Ñ$4´R·W±W·_±_ÀTÇYÁYÓ5OÓ$PÓQÓRˆDà =Š=ܘ$Ÿ-™-Ó(ˆEØ$Ÿz™z˜l¨"¨U¯]©]¨OÐ<‰Mð!×-Ñ-‰Mðˆ ä Ð,Ó -€Fõ.õ
)ð$РÙ"3°MÓ"B‰àˆä ˜C  w°Ó 7Ð7r&)r{r|r}r~rršr€r‚có˜—t||«}
t|
j||
j|
j|||||    ||
j
|¬« S)aCreates an InstallRequirement from a name, which might be a
    requirement, directory containing 'setup.py', filename, or URL.
 
    :param line_source: An optional string describing where the line is from,
        for logging purposes in case of an error.
    )
rJrmr{r|r}r~r‚rr"r€)r±rrlrJrmr") rwr„r{r|r}r~rršr€r‚r†s            r$rr„sS€ô&    kÓ 2€Eä Ø ×ÑØØ Z‰ZØ— ‘ ØØØ%Ø!Ø'ØØ|‰|Ø#ô ð r&cóZ—    t|«}tjt
jg}|j rB|r@|jr4|jj|vrtd|j›d|›d«‚t|||||¬«S#t$r}td|›d|›«‚d}~wwxYw)NrurvzZPackages installed from PyPI cannot depend on packages which are not also hosted on PyPI.
z  depends on ú )r|r{r€) rrr
r Úfile_storage_domainr rFrJÚnetlocrwr)Ú
req_stringr„r|r{r€r7ryÚdomains_not_alloweds        r$Úinstall_req_from_req_stringr¹©sʀðOܘjÓ)ˆô
     × Ñ Ü×$Ñ$ðÐð
     ŠÙ Ø OŠOØ O‰O× "Ñ "Ð&9Ñ 9ô ð 3à‰Ð˜|¨C¨5°ð 3ó
ð    
ô Ø ØØØØ#ô  ðøô) òOÜÐ"7¸
°~ÀRÈÀuРMÓNÐNûðOús‚ B      B*ÂB%Â%B*c óœ—|jr2t|j|j||j|||¬«}|St |j|j|||j r|j jdg«ng|j r|j jdi«ni|j|j||¬«
}|S)N)r„r{rr|r€r‚r}Úhashes)    r„r{r|r}r~rršr€r‚)    Ú is_editablerrlr„rrÚoptionsÚgetrš)Ú
parsed_reqr|r{r€r‚r7s      r$Ú#install_req_from_parsed_requirementrÀÏsӀð×ÒÜ'Ø × "Ñ "Ø!×,Ñ,Ø!Ø!×,Ñ,ØØ'Ø+ô
ˆð: €Jô%$Ø × "Ñ "Ø!×,Ñ,Ø!Øð×%Ò%ð×"Ñ"×&Ñ&Ð'7¸Ô<àð9C×8JÒ8J
×"Ñ"×&Ñ& x°Ô4ÐPRà!×,Ñ,Ø"×.Ñ.Ø'Ø+ô!
ˆð$ €Jr&c óö—t|j|j|j||j|j
|j |j|j|j|j¬« S)N) r7r„r…rJrmr{r|r}r~r‚r€) rr7r„r…rmr{r|r}r~r‚r€)rJÚireqs  r$Úinstall_req_from_link_and_ireqrÃ÷sb€ô Ø H‰HØ—?‘?Ø—‘Ø Ø— ‘ Ø—?‘?Ø—‘Ø×*Ñ*Ø×&Ñ&Ø×,Ñ,Ø×(Ñ(ô ð r&cód—t|jt|jt««nd||j|j
|j |j|j|j|j|jg|j|j|j¬«S)z¬
    Creates a new InstallationRequirement using the given template but without
    any extras. Sets the original requirement as the new one's parent
    (comes_from).
    N)r7r„r…rJrmr{r|r}r~rr"r‚r€r)rr7r;r)r…rJrmr{r|r}r~rr‚r€r)rÂs r$Úinstall_req_drop_extrasrÅ    s‹€ô à8<¿¹Ð8LÔ # D§H¡H¬c«eÔ 4ÐRVàØ—‘Ø Y‰YØ— ‘ Ø—?‘?Ø—‘Ø×*Ñ*Ø×&Ñ&Ø—?‘?ØØ×,Ñ,Ø×(Ñ(Ø#×:Ñ:ô! ðr&cóΗtj|«}h|j£|£|_|j't|j|j«|_|Sd|_|S)z
    Returns a copy of an installation requirement with some additional extras.
    Makes a shallow copy of the ireq object.
    N)Úcopyr"r7r;)rÂr"Úresults   r$Úinstall_req_extend_extrasrÉ#sg€ôY‰Yt‹_€FØ+d—k‘kÐ+ FÐ+€F„Mð 8‰8Ð ô      §¡¨&¯-©-Ó8ð „Jð
€Mðð „Jð
€Mr&)r r2r¥ztuple[str, str | None])r"ú
str | Noner¥rn)r7rr8rnr¥r)rEr2r¥z tuple[str | None, str, set[str]])r_r2r¥ÚNone)r7r2r¥r2)rEr2r¥rkrW)rEr2r„zInstallRequirement | str | Noner{ú bool | Noner|Úboolr}úlist[str] | Noner~údict[str, list[str]] | NonerrÍr€rÍrrÍr‚ú!dict[str, str | list[str]] | Noner¥r)rwr2r¥rÍ)r r2rwr2r¥rÊ)rwr2ršrÊr¥rk)rwr2r„zstr | InstallRequirement | Noner{rÌr|rÍr}rÎr~rÏrrÍršrÊr€rÍr‚rÐr¥r)NFNF) r·r2r„zInstallRequirement | Noner|rÍr{rÌr€rÍr¥r)FNFN) r¿rr|rÍr{rÌr€rÍr‚rÐr¥r)rJr rÂrr¥r)rÂrr¥r)rÂrr"zCollection[str]r¥r)CÚ__doc__Ú
__future__rrÇÚloggingr?rÚcollections.abcrÚ dataclassesrÚpip._vendor.packaging.markersrÚ"pip._vendor.packaging.requirementsrrÚ pip._vendor.packaging.specifiersr    Úpip._internal.exceptionsr
Úpip._internal.models.indexr r Úpip._internal.models.linkr Úpip._internal.models.wheelrÚpip._internal.req.req_filerÚpip._internal.req.req_installrÚpip._internal.utils.filetypesrÚpip._internal.utils.miscrÚpip._internal.utils.packagingrÚpip._internal.utils.urlsrÚpip._internal.vcsrrÚ__all__Ú    getLoggerroreÚ
_operatorsÚkeysr¢r%r+r;rrbrhrkrzrr‹r“r±rr¹rÀrÃrÅrÉrsr&r$ú<module>rèsÐðñõ#ã ÛÛ    Û    Ý&Ý!å0ßNÝ6å6ß5Ý*Ý,Ý8Ý<Ý9Ý7Ý9Ý0ß)ò €ð
ˆ×    Ñ    ˜8Ó    $€Ø ×  Ñ  × %Ñ %Ó '€    ó    "óBó 3ó24$ónó8ñ2 $Ô÷ðóðó >ð*37ðð#ØØ'+Ø04ØØØ#(Ø9=ñØðà/ððð    ð
ð ð %ð ð.ðððððð!ðð7ððóó@ó&óDL8ðb37ð"ð#ØØ'+Ø04ØØ"ØØ9=ñ"Ø
ð"à/ð"ðð    "ð
ð "ð %ð "ð.ð"ðð"ðð"ðð"ð7ð"ðó"ðN-1ØØ"Øð #Øð#à)ð#ðð#ðð    #ð
ð #ð ó #ðPØ"ØØ9=ð %Ø!ð%àð%ðð%ðð    %ð
7ð %ð ó %ðPØ
ðØ(ðàóó$ð4Ø
ðà ððôr&