2biY SrSSKrSSKrSSKrSSKrSSKrSSKJrJ r J r J r J r J r JrJrJrJrJr SSKJr SSKJrJr SSKJrJrJrJrJrJrJrJ r SSK!J"r"J#r#J$r$J%r% SSK&J'r' \(aSS KJ(r( S /r)\RT"\+5r,\\\-\\-4r.S \-S \/4S jr0S S\-S\-S\-S\\-S \-4 Sjjr1S\-S\-S \\-4Sjr2"SS\35r4"SS\35r5"SS5r6"SS5r7\7"5r8"SS5r9g)!z)Handles all VCS (version control) supportN) TYPE_CHECKINGAnyDictIterableIteratorListMappingOptionalTupleTypeUnion)SpinnerInterface) BadCommandInstallationError) HiddenTextask_path_exists backup_dir display_pathhide_url hide_valueis_installable_dirrmtree) CommandArgscall_subprocessformat_command_args make_command)get_url_scheme)LiteralvcsnamereturncP[U5nUcgU/SQ[R-;$)z+ Return true if the name looks like a URL. F)httphttpsfileftp)rr all_schemes)r schemes ڒ/builddir/build/BUILDROOT/alt-python313-pip-23.3.1-3.el8.x86_64/opt/alt/python313/lib/python3.13/site-packages/pip/_internal/vcs/versioncontrol.pyis_urlr*9s+D !F ~ 5G GGrepo_urlrev project_namesubdirc\URSS5nUSUSU3nU(aUSU3- nU$)z Return the URL for a VCS requirement. Args: repo_url: the remote VCS url, with any needed VCS prefix (e.g. "git+"). project_name: the (unescaped) project name. -_@z#egg=z&subdirectory=)replace)r,r-r.r/egg_project_namereqs r)make_vcs_requirement_urlr7CsH$++C5 JauE"2!3 4C  x(( Jr+location repo_rootcLUn[U5(dOUn[RRU5nX:Xa[R SU5 g[U5(dMO[RR X5(ag[RRX5$)z Find the the Python project's root by searching up the filesystem from `location`. Return the path to project root relative to `repo_root`. Return None if the project root is `repo_root`, or cannot be found. zOCould not find a Python project for directory %s (tried all parent directories)N)rospathdirnameloggerwarningsamefilerelpath)r8r9 orig_location last_locations r)(find_path_to_project_root_from_repo_rootrDUsM ** 77??8,  $ NN&  !** ww ,, 77??8 //r+c\rSrSrSrg)RemoteNotFoundErrorrN)__name__ __module__ __qualname____firstlineno____static_attributes__rHr+r)rFrFrsr+rFc0^\rSrSrS\4U4SjjrSrU=r$)RemoteNotValidErrorvurlc0>[TU]U5 XlgN)super__init__rQ)selfrQ __class__s r)rURemoteNotValidError.__init__ws r+rQ)rIrJrKrLstrrUrM __classcell__rWs@r)rOrOvsCr+rOc \rSrSrSrSS\SS\\S\\SS4S jjr S\4S jr \ S\\4S j5r S\4S jr S\4S jrS\SS4SjrSrg) RevOptions|z Encapsulates a VCS-specific revision to install, along with any VCS install options. Instances of this class should be treated as if immutable. Nvc_classVersionControlr- extra_argsr!c@Uc/nX0lX lXlSUlg)z Args: vc_class: a VersionControl subclass. rev: the name of the revision to install. extra_args: a list of extra options. N)rbr-r` branch_name)rVr`r-rbs r)rURevOptions.__init__s&  J$ *.r+cRSURRSUR<S3$)Nz )r`r r-rVs r)__repr__RevOptions.__repr__s&dmm001|1EEr+c`URcURR$UR$rS)r-r`default_arg_revrhs r)arg_revRevOptions.arg_revs% 88 ==00 0xxr+c~/nURnUbXRRU5- nXR- nU$)z, Return the VCS-specific command arguments. )rmr`get_base_rev_argsrb)rVargsr-s r)to_argsRevOptions.to_argss?ll ? MM33C8 8D  r+cFUR(dgSURS3$)Nz (to revision )r-rhs r) to_displayRevOptions.to_displaysxxz++r+cHURRXRS9$)zu Make a copy of the current instance, but with a new rev. Args: rev: the name of the revision for the new object. rb)r`make_rev_optionsrb)rVr-s r)make_newRevOptions.make_news }}--coo-NNr+)rdrbr-r`NN)rIrJrKrL__doc__r r rZrrUripropertyrmrrrxr}rMrHr+r)r^r^|s",0 /'(/c]/[) /  /(F#F#  ,C, OCOLOr+r^c.^\rSrSr%0r\\S4\S'/SQrSU4Sjjr S\ \4Sjr \ S\ S4S j5r\ S\ \4S j5r\ S\ \4S j5rS \SSS4S jrS\SS4SjrS\S\S4SjrS\S\S4SjrS\S\S4SjrSrU=r$) VcsSupportra _registry)sshgithgbzrsftpsvnr!Nc>[RRRUR5 [ TU]5 grS)urllibparse uses_netlocextendschemesrTrU)rVrWs r)rUVcsSupport.__init__s,    '' 5 r+c6URR5$rS)r__iter__rhs r)rVcsSupport.__iter__s~~&&((r+cH[URR55$rS)listrvaluesrhs r)backendsVcsSupport.backendssDNN))+,,r+cXURVs/sHoRPM sn$s snfrS)rr=)rVbackends r)dirnamesVcsSupport.dirnamess /3}}=}G}===s'cf/nURHnURUR5 M U$rS)rrr)rVrrs r)r'VcsSupport.all_schemess*}}G NN7?? +%r+clsc[US5(d![RSUR5 gURUR ;a?U"5UR UR'[R SUR5 gg)Nr zCannot register VCS %szRegistered VCS backend: %s)hasattrr>r?rIr rdebug)rVrs r)registerVcsSupport.registersasF## NN3S\\ B  884>> )'*uDNN388 $ LL5sxx @ *r+r c>XR;aURU ggrS)rrVr s r) unregisterVcsSupport.unregisters >> !t$ "r+r8c0nURR5HAnURU5nU(dM[R SXR 5 X2U'MC U(dg[ U[S9nX%$)z^ Return a VersionControl object if a repository of that type is found at the given directory. zDetermine that %s uses VCS: %sN)key)rrget_repository_rootr>rr maxlen)rVr8 vcs_backends vcs_backend repo_pathinner_most_repo_paths r)get_backend_for_dirVcsSupport.get_backend_for_dirss  >>002K#77AI LL98EUEU V&1 # 3 #>002K,,,""3r+cXUR5nURRU5$)r)lowerrgetrs r) get_backendVcsSupport.get_backends$zz|~~!!$''r+rH)r!N)rIrJrKrLrrrZ__annotations__rrUrrrrrrr'r rrr rrrrMr[r\s@r)rrs-/ItC))*/8G )(3-)-$/0-->$s)>>T#Y AD!12AtA%s%t%2C2H=M4N2.SX>N5O((1A(B((r+rc\rSrSr%SrSrSrSr\\ S4\ S'Sr \\ S4\ S'Sr \ \ \ S'\S \ S \4S j5r\S \ S \ \ 4S j5r\S\ S \ 4Sj5r\S\ S\ S \ 4Sj5r\S\ S \\ 4Sj5rS\ S\ S \4Sjr\SAS\ \ S\ \S \4Sjj5r\S\ S \4Sj5r\S\ S\ S \\ \\ \ \ \ 444Sj5r\S\ S \\ \ \ \44Sj5r\S\ \ S \ \S \4S!j5r S\S \\\44S"jr!\S\ S \ 4S#j5r"\S$\ S%\ S \4S&j5r#S\ S\S'\S(\$S S4 S)jr%S\ S\S'\S S4S*jr&S\ S\S'\S S4S+jr'\S\ S,\ \ S \4S-j5r(S\ S\S(\$S S4S.jr)S \ S\S(\$S S4S/jr*\S \ S \ 4S0j5r+\S \ S \ 4S1j5r,\SBS2\-\\ \4S3\S4\ \ S5S6S7\ \.\$S8\ \ S9\ \/\ \04S:\ \1S;\S<\S \ 4S=jj5r2\S>\ S \4S?j5r3\S \ S \ \ 4S@j5r4Sr5g)CrairurH.r unset_environNrl remote_urlr!cdUR5RURS35(+$)zv Return whether the vcs prefix (e.g. "git+") should be added to a repository's remote url when used in a requirement. :)r startswithr )rrs r)should_add_vcs_url_prefix(VersionControl.should_add_vcs_url_prefixs+ ##%00CHH:Q@@@r+r8cg)zy Return the path to Python project root, relative to the repo root. Return None if the project root is in the repo root. NrHrr8s r)get_subdirectoryVersionControl.get_subdirectory$s r+repo_dirc$URU5$)zB Return the revision string that should be used in a requirement. ) get_revision)rrs r)get_requirement_revision'VersionControl.get_requirement_revision,s ))r+r.cURU5nURU5(aURSU3nURU5nUR U5n[ X4X%S9nU$)a  Return the requirement string to use to redownload the files currently at the given repository directory. Args: project_name: the (unescaped) project name. The return value has a form similar to the following: {repository_url}@{revision}#egg={project_name} +)r/)get_remote_urlrr rrr7)rrr.r,revisionr/r6s r)get_src_requirement"VersionControl.get_src_requirement3sj%%h/  ( ( 2 2((1XJ/H//9%%h/&x<W r+r-c[e)zy Return the base revision arguments for a vcs command. Args: rev: the name of a revision to install. Cannot be None. NotImplementedErrorrws r)rp VersionControl.get_base_rev_argsK "!r+rQdestcg)a" Return true if the commit hash checked out at dest matches the revision in url. Always return False, if the VCS does not support immutable commit hashes. This method does not check if there are local uncommitted changes in dest after checkout, as pip currently has no use case for that. FrH)rVrQrs r)is_immutable_rev_checkout(VersionControl.is_immutable_rev_checkoutUsr+rbc[XUS9$)zu Return a RevOptions object. Args: rev: the name of a revision to install. extra_args: a list of extra options. r{)r^)rr-rbs r)r|VersionControl.make_rev_optionsbs#z::r+repoc[RRU5up#UR[RR5=(d [ U5$)z[ posix absolute paths start with os.path.sep, win32 ones start with drive (like c:\folder) )r;r< splitdriversepbool)rrdrivetails r)_is_local_repository#VersionControl._is_local_repositoryos: gg((. rww{{+:tE{:r+netlocr(c US4$)a Parse the repository URL's netloc, and return the new netloc to use along with auth information. Args: netloc: the original repository URL netloc. scheme: the repository URL's scheme without the vcs prefix. This is mainly for the Subversion class to override, so that auth information can be provided via the --username and --password options instead of through the URL. For other subclasses like Git without such an option, auth information must stay in the URL. Returns: (netloc, (username, password)). rrH)rrr(s r)get_netloc_and_auth"VersionControl.get_netloc_and_authxs&|##r+c[RRU5up#pEnSU;a[SR U55eUR SS5SnUR X25up7SnSU;a5URSS5upHU(d[SR U55e[RRX#XES45nXU4$)z Parse the repository URL to use, and return the URL, revision, and auth info to use. Returns: (url, rev, (username, password)). rzvSorry, {!r} is a malformed VCS url. The format is +://, e.g. svn+http://myrepo/svn/MyApp#egg=MyAppNr3zyThe URL {!r} has an empty revision (after @) which is not supported. Include a revision after @ or remove @ from the URL.ru) rrurlsplit ValueErrorformatsplitrrsplitr urlunsplit) rrQr(rr<queryfrag user_passr-s r)get_url_rev_and_auth#VersionControl.get_url_rev_and_auths-3LL,A,A#,F)T f ==CVC[  c1%a(33FC $; C+ID'006s  ll%%vtB&GH""r+usernamepasswordc/$)z= Return the RevOptions "extra arguments" to use in obtain(). rH)rrs r) make_rev_argsVersionControl.make_rev_argss  r+cURUR5up#nUupVSnUb [U5nURXW5nUR X8S9n [ U5U 4$)zY Return the URL and RevOptions object to use in obtain(), as a tuple (url, rev_options). Nr{)rsecretrrr|r) rVrQ secret_urlr-rrsecret_passwordrrb rev_optionss r)get_url_rev_options"VersionControl.get_url_rev_optionssm &*%>%>szz%J" $-!)-  &!/2H''; ++C+G  #[00r+c^[RRU5RS5$)zQ Normalize a URL for comparison by unquoting it and removing any trailing slash. /)rrunquoterstriprYs r) normalize_urlVersionControl.normalize_urls$ ||##C(//44r+url1url2cHURU5URU5:H$)zF Compare two repo URLs for identity, ignoring incidental differences. )r )rrrs r) compare_urlsVersionControl.compare_urlss%   &#*;*;D*AAAr+r verbosityc[e)z Fetch a revision from a repository, in the case that this is the first fetch from the repository. Args: dest: the directory to fetch the repository to. rev_options: a RevOptions object. verbosity: verbosity level. r)rVrrQrrs r) fetch_newVersionControl.fetch_news "!r+c[e)z] Switch the repo at ``dest`` to point to ``URL``. Args: rev_options: a RevOptions object. rrVrrQrs r)switchVersionControl.switch "!r+c[e)zj Update an already-existing repo to the given ``rev_options``. Args: rev_options: a RevOptions object. rrs r)updateVersionControl.updaterr+r c[e)z Return whether the id of the current commit equals the given name. Args: dest: the repository directory. name: a string name. r)rrr s r)is_commit_id_equal!VersionControl.is_commit_id_equals "!r+cURU5up$[RRU5(dUR XXCS9 gUR 5nUR U5(GaURU5nURXbR5(a[RSURR5[U5U5 URXR 5(d>[R#S[U5URU5 UR%XU5 g[R#S5 g[R'SUR(UR[U5U5 SnO.[R'SUUR(UR5 S n[R'S UR(U5 [+S R-US 5US 5nUS:Xa[.R0"S5 US:Xa;[R'S[U55 [3U5 UR XXCS9 gUS:XaR[5U5n [R'S[U5U 5 [6R8"X5 UR XXCS9 gUS:Xa?[R#SUR[U5UU5 UR;XU5 gg)z Install or update in editable mode the package represented by this VersionControl object. :param dest: the repository directory in which to install or update. :param url: the repository URL starting with a vcs prefix. :param verbosity: verbosity level. )rNz)%s in %s exists, and has correct URL (%s)zUpdating %s %s%sz$Skipping because already up-to-date.z%s %s in %s exists with URL %s)z%(s)witch, (i)gnore, (w)ipe, (b)ackup )siwbz0Directory %s already exists, and is not a %s %s.)z(i)gnore, (w)ipe, (b)ackup )r$r%r&z+The plan is to install the %s repository %szWhat to do? {}rrar%z Deleting %sr&zBacking up %s to %sr#zSwitching %s %s to %s%s)rr;r<existsrrxis_repository_directoryrrrr>r repo_nametitlerr r-inforr?r rrsysexitrrshutilmover) rVrrQrr rev_display existing_urlpromptresponsedest_dirs r)obtainVersionControl.obtainsk 33C8ww~~d## NN4kN G !,,.  ' ' - -..t4L  zz:: ?NN((* &  ..t__EEKK*$T*#  KK;7KK FG NN0 T"  UF NNB   FF 9 II  ##4#;#;F1I#Fq R s? HHRL s? NN=,t*< = 4L NN4kN G  s?!$'H NN0,t2Dh O KK ' NN4kN G  s? KK)T"   KK; / r+c[RRU5(a [U5 UR XUS9 g)z Clean up current location and download the url repository (and vcs infos) into location :param url: the repository URL starting with a vcs prefix. :param verbosity: verbosity level. )rQrN)r;r<r)rr7)rVr8rQrs r)unpackVersionControl.unpackVs/ 77>>( # # 8  H ;r+c[e)zv Return the url used at location Raises RemoteNotFoundError if the repository does not have a remote url configured. rrs r)rVersionControl.get_remote_urlbrr+c[e)zB Return the current commit id of the files at the given location. rrs r)rVersionControl.get_revisionls "!r+cmd show_stdoutcwd on_returncodez"Literal["raise", "warn", "ignore"]extra_ok_returncodes command_desc extra_environspinnerlog_failed_cmd stdout_onlyc 8[UR/UQ76nUc [U5n[UUUUUUUURUU U S9 $![ a) [ SUR<SUR<S35e[a [ SUR<S35ef=f)z Run a VCS subcommand This is simply a wrapper around call_subprocess that adds the VCS command name, and checks that the VCS is available )rCrDrErFrrGrHrIzCannot find command z - do you have z installed and in your PATH?zNo permission to execute z - install it locally, globally (ask admin), or check your PATH. See possible solutions at https://pip.pypa.io/en/latest/reference/pip_freeze/#fixing-permission-denied.)rr rrrFileNotFoundErrorrPermissionError) rr@rArBrCrDrErFrGrHrIs r) run_commandVersionControl.run_commandss&388*c*  .s3L "+%9)+!//-'  ! &sxxl/88,:<   +CHH<8-.  s AABr<c[RSXRUR5 [R R [R RXR55$)z< Return whether a directory path is a repository directory. zChecking in %s for %s (%s)...)r>rr=r r;r<r)join)rr<s r)r*&VersionControl.is_repository_directorysA  4dKKRww~~bggll4=>>r+c4URU5(aU$g)aA Return the "root" (top-level) directory controlled by the vcs, or `None` if the directory is not in any. It is meant to be overridden to implement smarter detection mechanisms for specific vcs. This can do more than is_repository_directory() alone. For example, the Git override checks that Git is actually available. N)r*rs r)r"VersionControl.get_repository_roots  & &x 0 0Or+r) TNraiseNNNNTF)6rIrJrKrLr r=r+rr rZrrrlr classmethodrrrrr staticmethodrrprrr^r|rrAuthInforrrrr rintrrrr r7r:rrr rr rrrMr*rrMrHr+r)raras DGI!GU38_!%'M5c?'%)OXc])A3A4AA **** 3cc."s"tCy"" S   LP ;3- ;4<[4I ;  ; ;;;;;$$"%$ sE(3-#677 8$$(#s#uS(3-5Q/R##:3-+3J+?  1z 1eJ E8<&*59.2#!5 49k) *55c] 5 < 5 'x}5 5sm5 S 125*+555 55n?3?4?? 3 8C=  r+rarS):rloggingr;r0r. urllib.parsertypingrrrrrrr r r r r pip._internal.cli.spinnersrpip._internal.exceptionsrrpip._internal.utils.miscrrrrrrrrpip._internal.utils.subprocessrrrrpip._internal.utils.urlsrr__all__ getLoggerrIr>rZrWrr*r7rD ExceptionrFrOr^rrrarHr+r)rdsC/     8B    4 '   8 $ # - .HHHIM+.8@ $00!0 c]0: ) ) @O@OFM(M(`loor+