U .e@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. cCs~g}|D]0}|dr.t|}tj|r.|}||qtsrt||D]&}t |}|j dkrJt dqrqJ|||dS)zQ Create a SearchScope object after normalizing the `find_links`. ~Zhttpszipip is configured with locations that require TLS/SSL, however the ssl module in Python is not available. find_links index_urls) startswithrospathexistsappendr itertoolschain urllib_parseZurlparseZschemeloggerZwarning)clsr rZbuilt_find_linkslinkZnew_linkZparsedrE/usr/lib/python3.8/site-packages/pip/_internal/models/search_scope.pycreates&     zSearchScope.createcCs||_||_dSNr )selfr rrrr__init__GszSearchScope.__init__cCslg}|jr:|jtjgkr:|dddd|jD|jrb|dddd|jDd|S)NzLooking in indexes: {}z, css|]}t|VqdSrr.0urlrrr Usz6SearchScope.get_formatted_locations..zLooking in links: {}css|]}t|VqdSrr r!rrrr$Zs )rrZ simple_urlrformatjoinr )rlinesrrrget_formatted_locationsPsz#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/) posixpathr'rZquoterendswith)r#Zloc) project_namerrmkurl_pypi_urlgs  z.mkurl_pypi_urlcsg|] }|qSrrr!)r.rr tsz8SearchScope.get_index_urls_locations..)r)rr-r)r.r-rget_index_urls_locations_s z$SearchScope.get_index_urls_locationsN) __name__ __module__ __qualname____doc__ classmethodrrr)r0rrrrr s  ( r )rZloggingrr+Zpip._vendor.packaging.utilsrZpip._vendor.six.moves.urllibrrZpip._internal.models.indexrZpip._internal.utils.compatrZpip._internal.utils.miscrrZpip._internal.utils.typingrtypingr Z getLoggerr1robjectr rrrrs