\h#ddlZddlZddlZddlZddlZddlmZddlm Z ddl m Z ddl m Z ddlmZmZej"eZGddZy) N)List)canonicalize_name)PyPI)has_tls)normalize_pathredact_auth_from_urlc eZdZdZgdZedeedeededdfdZ deedeededdfd Z defd Z d edeefd Z y) SearchScopezF Encapsulates the locations that pip is configured to search.  find_links index_urlsno_indexr r rreturncg}|D]P}|jdr,t|}tjj |r|}|j |Rt s`tj||D]G}tjj|}|jdk(s2tjdn||||S)zQ Create a SearchScope object after normalizing the `find_links`. ~httpszipip is configured with locations that require TLS/SSL, however the ssl module in Python is not available.r ) startswithrospathexistsappendr itertoolschainurllibparseurlparseschemeloggerwarning)clsr r rbuilt_find_linkslinknew_linkparseds d/root/niggaflix-v3/playground/venv/lib/python3.12/site-packages/pip/_internal/models/search_scope.pycreatezSearchScope.creates') *Ds#)$/77>>(+#D  # #D )  *y! 4DE ..t4==G+NN%  '!  Nc.||_||_||_yNr )selfr r rs r%__init__zSearchScope.__init__Cs %$  r'cjg}g}|jr|jtjgk7r|jD]k}t|}tj j |}|js"|jstjd||j|m|jdjdj||jr@|jdjdjd|jDdj|S)Nz:The index url "%s" seems invalid, please provide a scheme.zLooking in indexes: {}z, zLooking in links: {}c32K|]}t|ywr))r).0urls r% z6SearchScope.get_formatted_locations..ksSC237Ss )r r simple_urlrrrurlsplitrnetlocrrrformatjoinr )r*linesredacted_index_urlsr/redacted_index_urlpurls r%get_formatted_locationsz#SearchScope.get_formatted_locationsMs  ??t4??2CC ?%9#%>"||,,-?@{{4;;NNT* $**+=># ?& LL(// :M0NO  ?? LL&--IIS4??SS  yyr' project_namecrdtdtffd }|jDcgc] }|| c}Scc}w)zReturns the locations found via self.index_urls Checks the url_name on the main (first in the list) index and use this url_name to produce all locations r/rctj|tjj t }|j ds|dz}|S)N/) posixpathr6rrquoterendswith)r/locr<s r%mkurl_pypi_urlz.mkurl_pypi_urlwsG..V\\''(9,(GHC<<$CiJr')strr )r*r<rDr/s ` r%get_index_urls_locationsz$SearchScope.get_index_urls_locationsps5   04?s#???s4) __name__ __module__ __qualname____doc__ __slots__ classmethodrrEboolr&r+r;rFr'r%r r s9I' I' I'  '  ' ' R!I!I! !  !! ! F@S@T#Y@r'r )rloggingrr@ urllib.parsertypingrpip._vendor.packaging.utilsrpip._internal.models.indexrpip._internal.utils.compatrpip._internal.utils.miscrr getLoggerrGrr rNr'r%rWsC 9+.I   8 $s@s@r'