kgh!ddlZddlZddlZddlmZddlmZmZmZm Z m Z m Z ddl m Z mZmZmZmZddlmZddlmZddlmZmZddlmZejeZeeZeeZeegeefZ 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)InvalidSdistFilenameInvalidWheelFilenamecanonicalize_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.6.0/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_filer0+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)rr3s r__init__z_FlatDirectoryToUrls.__init__2s/ +-;Ft;L;L""'rctj|jD]}t|j}t |r|j|@ t|j d}n=#t$r0 t|j d}n#t$rYYwxYwYnwxYw|j ||d|_dS)zrScans directory once and populates both page_candidates and project_name_to_urls at the same time rTN)osscandirr5rr3r0r6appendrnamer r r r8r9)rentryurlproject_filenames r_scan_directoryz$_FlatDirectoryToUrls._scan_directory8s Z ++ E EEej))CS!! %,,S111 #7 #C#CA#F  '   ';EJ'G'G'J$$+HH%$   &'7 8 ? ? D D D D"&s6A66 B0BB0 B*&B0)B**B0/B0cF|js||jSN)r9rCr6rs rr z$_FlatDirectoryToUrls.page_candidatesOs(& #  " " "$$rcF|js||jSrE)r9rCr8rs rproject_name_to_urlsz)_FlatDirectoryToUrls.project_name_to_urlsVs(& #  " " "))r)rN) r$r%r&__doc__strr:rCr'rr rrGr*rrr2r2/s,,(S(T(((( ''''.%c%%%X% *d3S >&:***X***rr2ceZdZUdZiZeeefed<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_pager3 project_namerNc||_t||_||jvr|j||_dSt ||_|j|j|<dS)N)r3)_candidates_from_pager _project_namerL _path_to_urlsr2)rrMr3rNs rr:z_FlatDirectorySource.__init__isk &:".|<< 4& & &!%!4T!:D   !54!@!@!@D (,(:D  % % %rcdSrEr*rs rrz_FlatDirectorySource.linkystrc#xK|jjD]*}|t|Ed{V+dSrE)rRr rPrrrAs rr z$_FlatDirectorySource.page_candidates}sT%5 = =C11$s))<< < < < < < < < < = =rc#`K|jj|jD]}t|VdSrE)rRrGrQrrUs rr#z_FlatDirectorySource.file_linkss>%:4;MN  Cs))OOOO  r)r$r%r&rHrLrrIr2__annotations__CandidatesFromPager:r'rrrr(r r)r#r*rrrKrK^s79ND223888;0;; ;  ;;;; htnX=====JrrKcfeZdZdZdededdfdZedeefdZ 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. rMrrNc"||_||_dSrErP_linkrrMrs rr:z_LocalFileSource.__init__ &:" rc|jSrEr]rs rrz_LocalFileSource.link zrc#Kt|jjsdS||jEd{VdSrE)r0r]rArPrs rr z _LocalFileSource.page_candidatessMTZ^,,  F--dj99999999999rc#RKt|jjrdS|jVdSrE)r0r]rArs rr#z_LocalFileSource.file_linkss3  ( (  Fjrr$r%r&rHrXrr:r'rrr(r r)r#r*rrrZrZs0  htnX::::: JrrZcjeZdZdZdedededdfdZede 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. rMpage_validatorrrNc0||_||_||_dSrE)rP_page_validatorr])rrMrhrs rr:z_RemoteFileSource.__init__s &:"- rc|jSrErars rrz_RemoteFileSource.linkrbrc#K||jsdS||jEd{VdSrE)rjr]rPrs rr z!_RemoteFileSource.page_candidatessQ##DJ//  F--dj99999999999rc#K|jVdSrErars rr#z_RemoteFileSource.file_linkssjr)r$r%r&rHrX PageValidatorrr:r'rrr(r r)r#r*rrrgrgs0&   htnX::::: JrrgcfeZdZdZdededdfdZedeefdZ 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. rMrrNc"||_||_dSrEr\r^s rr:z_IndexDirectorySource.__init__r_rc|jSrErars rrz_IndexDirectorySource.linkrbrc#JK||jEd{VdSrEr\rs rr z%_IndexDirectorySource.page_candidatess4--dj99999999999rcdS)Nr*r*rs rr#z _IndexDirectorySource.file_linkssrrrer*rrrprps 0  htnX:::::JrrplocationrMrh expand_dircache_link_parsingrNcd}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)rw)rMrhr)rMr3rN)rMrz?Location '%s' is ignored: it is neither a file nor a directory.)r<r3existsr startswithrrloggerwarningrgrisdirrKrpisfilerZ) rurMrhrvrwrNr3rAmsgsources 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 rpip._internal.models.candidaterpip._internal.models.linkrpip._internal.utils.urlsrrpip._internal.vcsr getLoggerr$r{r(r)rXboolrnrrIr0r2rKrZrgrprr*rrrs ######BBBBBBBBBBBBBBBBA@@@@@******========$$$$$$  8 $ $01 d^ tfh/D&EEF$&  $ $ $ $ $ $ $ $JCJDJJJJ,*,*,*,*,*,*,*,*^%%%%%:%%%PzB @J4;;-;" ;  ;  ;; 8C=(:. ./;;;;;;r