ޘ^fddlmZddlZddlZddlZddlmZddlmZddl m Z ddl m Z m Z mZmZmZddlmZddlmZdd lmZmZdd lmZejeZeeZeeZe egeefZe ege fZ!Gd d Z"d&dZ#GddZ$Gdde"Z%Gdde"Z&Gdde"Z'Gdde"Z(d'd%Z)dS)() annotationsN) defaultdict)Iterable)Callable)InvalidSdistFilenameInvalidWheelFilenamecanonicalize_nameparse_sdist_filenameparse_wheel_filename)InstallationCandidate)Link) path_to_url url_to_path)is_urlc6eZdZed dZd dZd dZdS) LinkSourcereturn Link | Nonect)z,Returns the underlying link, if there's one.NotImplementedErrorselfs m/builddir/build/BUILD/cloudlinux-venv-1.0.10/venv/lib/python3.11/site-packages/pip/_internal/index/sources.pylinkzLinkSource.link s"###FoundCandidatesct)z9Candidates found by parsing an archive listing HTML file.rrs rpage_candidateszLinkSource.page_candidates%!###r FoundLinksct)z,Links found by specifying archives directly.rrs r file_linkszLinkSource.file_links)r rNrrrrrr!)__name__ __module__ __qualname__propertyrrr#rrrrsZ $$$X$$$$$$$$$$$rrfile_urlstrrboolcBtj|dddkS)NF)strictrz text/html) mimetypes guess_type)r,s r _is_html_filer3.s"   7 7 7 :k IIrcReZdZdZd dZddZedd Zedd Zd S)_FlatDirectoryToUrlsz"Scans directory and caches resultspathr-rNonecb||_g|_tt|_d|_dS)NF)_path_page_candidatesrlist_project_name_to_urls_scanned_directory)rr6s r__init__z_FlatDirectoryToUrls.__init__5s/ +-;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)osscandirr9rr6r3r:appendr namerr rr<r=)rentryurlproject_filenames r_scan_directoryz$_FlatDirectoryToUrls._scan_directory;s 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/B0 list[str]cF|js||jSN)r=rGr:rs rrz$_FlatDirectoryToUrls.page_candidatesRs(& #  " " "$$rdict[str, list[str]]cF|js||jSrJ)r=rGr<rs rproject_name_to_urlsz)_FlatDirectoryToUrls.project_name_to_urlsYs(& #  " " "))rN)r6r-rr7)rr7)rrH)rrK) r'r(r)__doc__r>rGr*rrMr+rrr5r52s,,(((( ''''.%%%X% ***X***rr5cReZdZUdZiZded<dd Zedd ZddZ ddZ dS)_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. zdict[str, _FlatDirectoryToUrls]_paths_to_urlscandidates_from_pageCandidatesFromPager6r- project_namerr7c||_t||_||jvr|j||_dSt ||_|j|j|<dS)N)r6)_candidates_from_pager _project_namerQ _path_to_urlsr5)rrRr6rTs rr>z_FlatDirectorySource.__init__lsk &:".|<< 4& & &!%!4T!:D   !54!@!@!@D (,(:D  % % %rrcdSrJr+rs rrz_FlatDirectorySource.link|strrc#xK|jjD]*}|t|Ed{V+dSrJ)rXrrVr rrEs rrz$_FlatDirectorySource.page_candidatessT%5 = =C11$s))<< < < < < < < < < = =rr!c#`K|jj|jD]}t|VdSrJ)rXrMrWr r[s rr#z_FlatDirectorySource.file_linkss>%:4;MN  Cs))OOOO  rN)rRrSr6r-rTr-rr7r$r%r&) r'r(r)rNrQ__annotations__r>r*rrr#r+rrrPrPas79N8888;;;; X====rrPcBeZdZdZddZedd Zdd ZddZdS)_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. rRrSrr rr7c"||_||_dSrJrV_linkrrRrs rr>z_LocalFileSource.__init__ &:" rrc|jSrJrbrs rrz_LocalFileSource.link zrrc#Kt|jjsdS||jEd{VdSrJ)r3rbrErVrs rrz _LocalFileSource.page_candidatessMTZ^,,  F--dj99999999999rr!c#RKt|jjrdS|jVdSrJ)r3rbrErs rr#z_LocalFileSource.file_linkss3  ( (  FjrNrRrSrr rr7r$r%r& r'r(r)rNr>r*rrr#r+rrr_r_szX:::: rr_cBeZdZdZdd Zedd ZddZddZdS)_RemoteFileSourcez``--find-links=`` or ``--[extra-]index-url=``. This returns: * ``page_candidates``: Links listed on an HTML file. * ``file_candidates``: The non-HTML file. rRrSpage_validator PageValidatorrr rr7c0||_||_||_dSrJ)rV_page_validatorrb)rrRrnrs rr>z_RemoteFileSource.__init__s &:"- rrc|jSrJrfrs rrz_RemoteFileSource.linkrgrrc#K||jsdS||jEd{VdSrJ)rqrbrVrs rrz!_RemoteFileSource.page_candidatessQ##DJ//  F--dj99999999999rr!c#K|jVdSrJrfrs rr#z_RemoteFileSource.file_linkssjrN)rRrSrnrorr rr7r$r%r&rkr+rrrmrmszX:::: rrmcBeZdZdZddZedd Zdd ZddZdS)_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. rRrSrr rr7c"||_||_dSrJrarcs rr>z_IndexDirectorySource.__init__rdrrc|jSrJrfrs rrz_IndexDirectorySource.linkrgrrc#JK||jEd{VdSrJrars rrz%_IndexDirectorySource.page_candidatess4--dj99999999999rr!cdS)Nr+r+rs rr#z _IndexDirectorySource.file_linkssrrNrjr$r%r&rkr+rrrvrvsz X::::rrvlocationrRrSrnro expand_dircache_link_parsingrT$tuple[str | None, LinkSource | None]cd}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)r})rRrnr)rRr6rT)rRrz?Location '%s' is ignored: it is neither a file nor a directory.)r@r6existsr startswithrrloggerwarningrmr isdirrPrvisfiler_) r{rRrnr|r}rTr6rEmsgsources r build_sourcersDC w~~h(##   W % %8$$    { K  sH%%%| |.!5)c.@AAA    V} w}}T  )%9)FF +%9#2DEEEFV}   !!5c.@AAA   V} NNI ;r)r,r-rr.)r{r-rRrSrnror|r.r}r.rTr-rr~)* __future__rloggingr1r@ collectionsrcollections.abcrtypingrpip._vendor.packaging.utilsrrr r r pip._internal.models.candidater pip._internal.models.linkr pip._internal.utils.urlsrrpip._internal.vcsr getLoggerr'rrr!rSr.rorr3r5rPr_rmrvrr+rrrs"""""" ######$$$$$$A@@@@@******========$$$$$$  8 $ $01 d^ tfh/D&EEF$&  $ $ $ $ $ $ $ $JJJJ,*,*,*,*,*,*,*,*^%%%%%:%%%PzB @J4;;;;;;r