7f!ddlZddlZddlZddlmZddlmZmZmZm Z m Z m Z ddl m Z mZmZmZmZmZddlmZddlmZddlmZmZddlmZejeZeeZeeZ eegeefZ!eege"fZ#Gd d Z$d e%d e"fd Z&GddZ'Gdde$Z(Gdde$Z)Gdde$Z*Gdde$Z+de%de!de#de"de"de%d e e e%e e$ffdZ,dS)N) defaultdict)CallableDictIterableListOptionalTuple)InvalidSdistFilenameInvalidVersionInvalidWheelFilenamecanonicalize_nameparse_sdist_filenameparse_wheel_filename)InstallationCandidate)Link) path_to_url url_to_path)is_urlcNeZdZedeefdZdefdZde fdZ dS) LinkSourcereturnct)z,Returns the underlying link, if there's one.NotImplementedErrorselfs {/builddir/build/BUILD/imunify360-venv-2.3.5/opt/imunify360/venv/lib/python3.11/site-packages/pip/_internal/index/sources.pylinkzLinkSource.links"###ct)z9Candidates found by parsing an archive listing HTML file.rrs rpage_candidateszLinkSource.page_candidates#!###rct)z,Links found by specifying archives directly.rrs r file_linkszLinkSource.file_links'r"rN) __name__ __module__ __qualname__propertyrrrFoundCandidatesr! FoundLinksr$rrrrss $htn$$$X$$$$$$$J$$$$$$rrfile_urlrcBtj|dddkS)NF)strictrz text/html) mimetypes guess_type)r,s r _is_html_filer1,s"   7 7 7 :k IIrceZdZdZdeddfdZd dZedeefdZ ede eeeffdZ dS) _FlatDirectoryToUrlsz"Scans directory and caches resultspathrNcb||_g|_tt|_d|_dS)NF)_path_page_candidatesrlist_project_name_to_urls_scanned_directory)rr4s r__init__z_FlatDirectoryToUrls.__init__3s/ +-;Ft;L;L""'rctj|jD]}t|j}t |r|j|@ t|j d}nK#ttf$r7 t|j d}n#ttf$rYYwxYwYnwxYw|j||d|_dS)zrScans directory once and populates both page_candidates and project_name_to_urls at the same time rTN)osscandirr6rr4r1r7appendrnamer r rr r9r:)rentryurlproject_filenames r_scan_directoryz$_FlatDirectoryToUrls._scan_directory9sZ ++ E EEej))CS!! %,,S111 #7 #C#CA#F  (.9   ';EJ'G'G'J$$,n=HH%$   &'7 8 ? ? D D D D"&s6A66B>B#"B>#B84B>7B88B>=B>cF|js||jSN)r:rDr7rs rr!z$_FlatDirectoryToUrls.page_candidatesPs(& #  " " "$$rcF|js||jSrF)r:rDr9rs rproject_name_to_urlsz)_FlatDirectoryToUrls.project_name_to_urlsWs(& #  " " "))r)rN) r%r&r'__doc__strr;rDr(rr!rrHr+rrr3r30s,,(S(T(((( ''''.%c%%%X% *d3S >&:***X***rr3ceZdZUdZiZeeefed<de dededdfdZ e de e fd Zdefd Zdefd ZdS) _FlatDirectorySourcezLink source specified by ``--find-links=``. This looks the content of the directory, and returns: * ``page_candidates``: Links listed on each HTML file in the directory. * ``file_candidates``: Archives in the directory. _paths_to_urlscandidates_from_pager4 project_namerNc||_t||_||jvr|j||_dSt ||_|j|j|<dS)N)r4)_candidates_from_pager _project_namerM _path_to_urlsr3)rrNr4rOs rr;z_FlatDirectorySource.__init__jsk &:".|<< 4& & &!%!4T!:D   !54!@!@!@D (,(:D  % % %rcdSrFr+rs rrz_FlatDirectorySource.linkzstrc#xK|jjD]*}|t|Ed{V+dSrF)rSr!rQrrrBs rr!z$_FlatDirectorySource.page_candidates~sT%5 = =C11$s))<< < < < < < < < < = =rc#`K|jj|jD]}t|VdSrF)rSrHrRrrVs rr$z_FlatDirectorySource.file_linkss>%:4;MN  Cs))OOOO  r)r%r&r'rIrMrrJr3__annotations__CandidatesFromPager;r(rrrr)r!r*r$r+rrrLrL_s79ND223888;0;; ;  ;;;; htnX=====JrrLcfeZdZdZdededdfdZedeefdZ de fdZ de fd Z dS) _LocalFileSourceaC``--find-links=`` or ``--[extra-]index-url=``. If a URL is supplied, it must be a ``file:`` URL. If a path is supplied to the option, it is converted to a URL first. This returns: * ``page_candidates``: Links listed on an HTML file. * ``file_candidates``: The non-HTML file. rNrrNc"||_||_dSrFrQ_linkrrNrs rr;z_LocalFileSource.__init__ &:" rc|jSrFr^rs rrz_LocalFileSource.link zrc#Kt|jjsdS||jEd{VdSrF)r1r^rBrQrs rr!z _LocalFileSource.page_candidatessMTZ^,,  F--dj99999999999rc#RKt|jjrdS|jVdSrF)r1r^rBrs rr$z_LocalFileSource.file_linkss3  ( (  Fjrr%r&r'rIrYrr;r(rrr)r!r*r$r+rrr[r[s0  htnX::::: Jrr[cjeZdZdZdedededdfdZede efdZ de fd Z de fd ZdS) _RemoteFileSourcez``--find-links=`` or ``--[extra-]index-url=``. This returns: * ``page_candidates``: Links listed on an HTML file. * ``file_candidates``: The non-HTML file. rNpage_validatorrrNc0||_||_||_dSrF)rQ_page_validatorr^)rrNrirs rr;z_RemoteFileSource.__init__s &:"- rc|jSrFrbrs rrz_RemoteFileSource.linkrcrc#K||jsdS||jEd{VdSrF)rkr^rQrs rr!z!_RemoteFileSource.page_candidatessQ##DJ//  F--dj99999999999rc#K|jVdSrFrbrs rr$z_RemoteFileSource.file_linkssjr)r%r&r'rIrY PageValidatorrr;r(rrr)r!r*r$r+rrrhrhs0&   htnX::::: JrrhcfeZdZdZdededdfdZedeefdZ de fdZ de fd Z dS) _IndexDirectorySourcez``--[extra-]index-url=``. This is treated like a remote URL; ``candidates_from_page`` contains logic for this by appending ``index.html`` to the link. rNrrNc"||_||_dSrFr]r_s rr;z_IndexDirectorySource.__init__r`rc|jSrFrbrs rrz_IndexDirectorySource.linkrcrc#JK||jEd{VdSrFr]rs rr!z%_IndexDirectorySource.page_candidatess4--dj99999999999rcdS)Nr+r+rs rr$z _IndexDirectorySource.file_linkssrrrfr+rrrqrqs 0  htnX:::::JrrqlocationrNri expand_dircache_link_parsingrOcd}d}tj|rt|}|}n8|dr|}t |}nt |r|}|d}t||dS|%t||t||} || fStj |r9|rt|||} n t|t||} || fStj|r$t|t||} || fStd||dfS) Nzfile:zVLocation '%s' is ignored: it is either a non-existing path or lacks a specific scheme.)NN)rx)rNrir)rNr4rO)rNrz?Location '%s' is ignored: it is neither a file nor a directory.)r=r4existsr startswithrrloggerwarningrhrisdirrLrqisfiler[) rvrNrirwrxrOr4rBmsgsources r build_sourcersDC w~~h(##   W % %8$$    { K  sH%%%| |.!5)c.@AAA    V} w}}T  )%9)FF +%9#2DEEEFV}   !!5c.@AAA   V} NNI ;r)-loggingr/r= collectionsrtypingrrrrrr pip._vendor.packaging.utilsr r r r rrpip._internal.models.candidaterpip._internal.models.linkrpip._internal.utils.urlsrrpip._internal.vcsr getLoggerr%r|r)r*rYboolrorrJr1r3rLr[rhrqrr+rrrs ######BBBBBBBBBBBBBBBBA@@@@@******========$$$$$$  8 $ $01 d^ tfh/D&EEF$&  $ $ $ $ $ $ $ $JCJDJJJJ,*,*,*,*,*,*,*,*^%%%%%:%%%PzB @J4;;-;" ;  ;  ;; 8C=(:. ./;;;;;;r