Re; dZddlZddlZddlZddlmZmZmZmZm Z m Z ddl m Z ddl mZmZddlmZddlmZmZddlmZdd lmZmZdd lmZdd lmZdd lmZdd l m!Z!ddl"m#Z#ddl$m%Z%ddl&m'Z'ddl(m)Z)ddl*m+Z+m,Z,gdZ-ej.e/Z0ej12Z3de4de e4ee4ffdZ5dee4dee4fdZ6de4de ee4e4ee4ffdZ7de4de4fdZ8GddZ9de4de9fdZ: d6de4d!ee e!e4fd"ee;d#e;d$eee4efd%e;d&e;d'e;de!fd(Zd)e4d,ee4de9fd-Z? d7d)e4d!ee e4e!fd"ee;d#e;d$eee4efd%e;d,ee4d&e;de!fd.Z@ d8d/e4d!ee!d#e;d"ee;d&e;de!f d0ZA d9d1ed#e;d"ee;d&e;de!f d2ZBd3ed4e!de!fd5ZCdS):a~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. N)AnyDictOptionalSetTupleUnion)Marker)InvalidRequirement Requirement) Specifier)RequirementParseErrorparse_requirements)InstallationError)PyPITestPyPI)Link)Wheel)ParsedRequirement)InstallRequirement)is_archive_file)is_installable_dir)get_requirement) path_to_url)is_urlvcs)install_req_from_editableinstall_req_from_lineparse_editablepathreturnctjd|}d}|r+|d}|d}n|}||fS)Nz^(.+)(\[[^\]]+\])$)rematchgroup)rmextraspath_no_extrass /builddir/build/BUILDROOT/alt-python311-pip-21.3.1-3.el8.x86_64/opt/alt/python311/lib/python3.11/site-packages/pip/_internal/req/constructors.py _strip_extrasr++sQ &--A F 6 !!r(ct|stStd|zjS)N placeholder)setrlowerr()r(s r*convert_extrasr17s1 uu =6<<>>9 : : AAr, editable_reqc|}t|\}}tj|rt |}|drSt|j}|r,||td|zj fS||tfStD]5}||dr |d|}n6t|}|j s4dtj}t!|d|d|j}|s"t!d|||tfS) 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).zZCould not detect requirement name for '{}', please specify one with #egg=your_package_name)r+osrisdirrr0 startswithr egg_fragmentrr(r/ris_vcsjoin all_schemesrformat)r2url url_no_extrasr( package_nameversion_controllinkbackendss r*rr=s C*#..M6 w}}]##3#M22 ''00 6M**7  6   >??F   5 5 99;; ! !_"7"7"7 8 8 $,,s,,C E  99D ; 99S_-- , ,' , , ,   $L   **0&*>*>    cee ##r,reqcd}tj|rd} t|5}t t ||d|z }dddn #1swxYwYn6#t$r t d|dYn wxYw|d|d z }|S) zReturns helpful msg in case requirements file does not exist, or cannot be parsed. :params req: Requirements file path z The path does exist. zThe argument you provided ({}) appears to be a requirements file. If that is the case, use the '-r' flag to install the packages specified within it.Nz&Cannot parse '%s' as requirements fileT)exc_infoz File 'z' does not exist.) r6rexistsopennextrreadr=r loggerdebug)rDmsgfps r*deduce_helpful_msgrPts" C w~~c0& Wc b' 223339 &++                % W W W LLA3QUL V V V V V W ///// Js5BAB; BB  BB B'B=<B=c VeZdZdeedeedeedeefdZ dS)RequirementParts requirementrBmarkersr(c>||_||_||_||_dSN)rSrBrTr()selfrSrBrTr(s r*__init__zRequirementParts.__init__s%'   r,N) __name__ __module__ __qualname__rr rr rstrrXr,r*rRrRs` k* tn &!  C      r,rRct|\}}}|2 t|}n##t$rtd|dwxYwd}t |}t ||d|S)NInvalid requirement: '')rr r rrrR)r2namer>extras_overriderDrBs r*parse_req_from_editablercs!/ !=!=D#  F)4T):):CC! F F F#$DT$D$D$DEE E F 99D Ct_ = ==s 'AF comes_from use_pep517isolatedoptions constraint user_suppliedpermit_editable_wheelsct|}t|j||d||j||||r|dgng|r|dgng|r|dini|j S)NTinstall_optionsglobal_optionshashes) rdrieditablerjrBrhrerfrlrm hash_optionsr()rcrrSrBgetr() r2rdrerfrgrhrirjpartss r*rrs $L 1 1E  #5 Z>EM $5r:::2.with_source4s' K--{----r, req_as_stringc t}|jD];}t|}|drd|d}t |zAparse_req_from_line.._parse_req_string..@s922(*m#222222r,z,= is not a valid operator. Did you mean == ?rFzInvalid requirement: z Hint: ) r specifierr\endswithrr r6rrurPany operators)rrDspecspec_strrNadd_msgrs` r*_parse_req_stringz.parse_req_from_line.._parse_req_string9sO 1!-00C(  1 1t99$$S))1?8???C+C0001 1'" ) ) )w{m++1-m<<< %%c2222.7222//%I+GmGGHHC ,+'+++#C(( ( )0 s ABC)rr{stripr r6rnormpathabspathrr+rschemer$searchr>ris_wheelrfilenameraversionr9r1r\r rR)rar marker_sepmarkers_as_stringrTrrrBextras_as_stringpr>wheelr(rrDrs ` @r*parse_req_from_linersB d||  T"&**Z";";-3355  0GG.//GG ::<EM $5r:::2rBnetlocr=rar)rrdrfrerirDdomains_not_alloweds r*install_req_from_req_stringrsHj)) HHH F F F FGGGH  $      O   O "&9 9 9  &z < <    #    s0 parsed_reqc |jr%t|j|j||j||}n0t |j|j|||j|j|j|}|S)N)rdrerhrfri)rdrerfrgrhrri) is_editablerrSrdrhrrgr)rrfrerirDs r*#install_req_from_parsed_requirementrs  '  "!,!!,'    $  "!,!&!,".'     Jr,rBireqc t|j|j|j||j|j|j|j|j|j  S)N) rDrdrorBrTrerfrlrmrp) rrDrdrorTrerfrlrmrp)rBrs r*install_req_from_link_and_ireqrsN  H?  ?,*&    r,)NNFNFFF)NNFNFNF)NFNF)FNF)D__doc__loggingr6r$typingrrrrrrpip._vendor.packaging.markersr "pip._vendor.packaging.requirementsr r pip._vendor.packaging.specifiersr pip._vendor.pkg_resourcesr rpip._internal.exceptionsrpip._internal.models.indexrrpip._internal.models.linkrpip._internal.models.wheelrpip._internal.req.req_filerpip._internal.req.req_installrpip._internal.utils.filetypesrpip._internal.utils.miscrpip._internal.utils.packagingrpip._internal.utils.urlsrpip._internal.vcsrr__all__ getLoggerrYrL _operatorskeysrr\r+r1rrPrRrcboolrrwrrrrrrr]r,r*rs 9999999999999999000000NNNNNNNN666666OOOOOOOO66666655555555******,,,,,,888888<<<<<<999999777777999999000000))))))))     8 $ $  % % ' '  " "c8C=&8 9 " " " "B8C=BSXBBBB 4$4$x}c3s8/K)L4$4$4$4$nCC8         ># >2B > > > >*<@!%(,#(13678  d38n %   !<34&S DW8cW8 W8BRW8W8W8W8x<@!%(,!% s$6678  d38n %   #H04!% ###+,## #  #  ####P!% !   < (r,