U n ah@sddlZddlZddlZddlZddlmZddlmZddl m Z ddl m Z ddl mZmZddlmZer|ddlmZeeZGd d d eZdS) N)canonicalize_name)parse)PyPI)has_tls)normalize_pathredact_auth_from_url)MYPY_CHECK_RUNNING)Listc@s4eZdZdZeddZddZddZdd Zd S) SearchScopezF Encapsulates the locations that pip is configured to search. cCsg}|D]0}|dr.t|}tj|r.|}||qtstt||D]&}t |}|j dkrLt dqtqL|||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. find_links index_urls) startswithrospathexistsappendr itertoolschain urllib_parseurlparseschemeloggerwarning)clsrrbuilt_find_linkslinknew_linkparsedr!bC:\Users\vtejo\AppData\Local\Temp\pip-unpacked-wheel-6mt8ur68\pip\_internal\models\search_scope.pycreates&     zSearchScope.createcCs||_||_dSNr )selfrrr!r!r"__init__DszSearchScope.__init__cCsg}g}|jrv|jtjgkrv|jD]<}t|}t|}|jsT|jsTt d || |q"| d d ||j r| d d dd|j Dd |S)Nz:The index url "{}" seems invalid, please provide a scheme.zLooking in indexes: {}z, zLooking in links: {}css|]}t|VqdSr$)r.0urlr!r!r" jsz6SearchScope.get_formatted_locations.. )rr simple_urlrrurlsplitrnetlocrrformatrjoinr)r%linesredacted_index_urlsr)redacted_index_urlpurlr!r!r"get_formatted_locationsMs.    z#SearchScope.get_formatted_locationscs fddfdd|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 cs,t|tt}|ds(|d}|S)N/) posixpathr0rquoterendswith)r)loc) project_namer!r"mkurl_pypi_urlws  z.mkurl_pypi_urlcsg|] }|qSr!r!r')r<r!r" sz8SearchScope.get_index_urls_locations..)r)r%r;r!)r<r;r"get_index_urls_locationsos z$SearchScope.get_index_urls_locationsN) __name__ __module__ __qualname____doc__ classmethodr#r&r5r>r!r!r!r"r s  ( "r )rloggingrr7pip._vendor.packaging.utilsrZpip._vendor.six.moves.urllibrrpip._internal.models.indexrpip._internal.utils.compatrpip._internal.utils.miscrrpip._internal.utils.typingrtypingr getLoggerr?robjectr r!r!r!r"s