U ��.e��@s�ddlZddlZddlZddlZddlmZddlmZddl m Z ddl m Z ddl mZmZddlmZer|ddlmZe�e�ZGd d �d e�ZdS) �N)�canonicalize_name)�parse)�PyPI)�HAS_TLS)�normalize_path�redact_auth_from_url)�MYPY_CHECK_RUNNING)�Listc@s4eZdZdZedd��Zdd�Zdd�Zdd �Zd S) � SearchScopezF Encapsulates the locations that pip is configured to search. cCs~g}|D]0}|�d�r.t|�}tj�|�r.|}|�|�qtsrt�||�D]&}t � |�}|j dkrJt � d�qrqJ|||d�S)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)� startswithr�os�path�exists�appendr� itertools�chain� urllib_parseZurlparseZscheme�loggerZwarning)�clsr rZbuilt_find_links�linkZnew_linkZparsed�r�E/usr/lib/python3.8/site-packages/pip/_internal/models/search_scope.py�creates&     ��zSearchScope.createcCs||_||_dS�Nr )�selfr rrrr�__init__GszSearchScope.__init__cCslg}|jr:|jtjgkr:|�d�d�dd�|jD����|jrb|�d�d�dd�|jD����d�|�S)NzLooking in indexes: {}z, css|]}t|�VqdSr�r��.0�urlrrr� Usz6SearchScope.get_formatted_locations..zLooking in links: {}css|]}t|�VqdSrr r!rrrr$Zs� )rrZ simple_urlr�format�joinr )r�linesrrr�get_formatted_locationsPs����z#SearchScope.get_formatted_locationscs �fdd���fdd�|jD�S)z�Returns 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�|t�t����}|�d�s(|d}|S)N�/)� posixpathr'rZquoter�endswith)r#Zloc)� project_namerr�mkurl_pypi_urlgs � z.mkurl_pypi_urlcsg|] }�|��qSrrr!)r.rr� tsz8SearchScope.get_index_urls_locations..)r)rr-r)r.r-r�get_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.typingr�typingr Z getLoggerr1r�objectr rrrr�s