o Ec@sddlZddlZddlZddlZddlZddlmZddlm Z ddl m Z ddl m Z ddlmZmZeeZGdddZdS) N)List)canonicalize_name)PyPI)has_tls)normalize_pathredact_auth_from_urlc@s|eZdZdZddgZedeedeeddfddZdeedeeddfdd Z defd d Z d edeefd dZ dS) SearchScopezF Encapsulates the locations that pip is configured to search. find_links index_urlsreturncCsg}|D]}|drt|}tj|r|}||qts;t||D]}t j |}|j dkr:t dnq&|||dS)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 r ) startswithrospathexistsappendr itertoolschainurllibparseurlparseschemeloggerwarning)clsr r Zbuilt_find_linkslinkZnew_linkparsedrT/opt/alt/python310/lib/python3.10/site-packages/pip/_internal/models/search_scope.pycreates(     zSearchScope.createNcCs||_||_dSNr)selfr r rrr __init__As zSearchScope.__init__cCsg}g}|jr:|jtjgkr:|jD]}t|}tj|}|js)|js)t d|| |q| d d ||jrN| d d dd|jDd |S)Nz:The index url "%s" seems invalid, please provide a scheme.zLooking in indexes: {}z, zLooking in links: {}css|]}t|VqdSr")r.0urlrrr hsz6SearchScope.get_formatted_locations.. )r rZ simple_urlrrrurlsplitrnetlocrrrformatjoinr )r#linesZredacted_index_urlsr'Zredacted_index_urlZpurlrrr get_formatted_locationsIs,     z#SearchScope.get_formatted_locations project_namecs*dtdtffdd fdd|jDS)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'r cs.t|tjt}|ds|d}|S)N/) posixpathr-rrquoterendswith)r'Zloc)r0rr mkurl_pypi_urlts  z.mkurl_pypi_urlcsg|]}|qSrrr%)r5rr sz8SearchScope.get_index_urls_locations..)strr )r#r0r)r5r0r get_index_urls_locationsms z$SearchScope.get_index_urls_locations) __name__ __module__ __qualname____doc__ __slots__ classmethodrr7r!r$r/r8rrrr rs( ' $r)rZloggingrr2 urllib.parsertypingrZpip._vendor.packaging.utilsrZpip._internal.models.indexrZpip._internal.utils.compatrZpip._internal.utils.miscrrZ getLoggerr9rrrrrr s