/usr/local/lib/python3.9/site-packages/pip/_internal/cli/__pycache__
a ���hU � @ s� d Z ddlmZ ddlZddlZddlZddlmZ ddlm Z ddl mZ ddlm Z ddlmZ dd lmZ er�dd lmZ ddlmZ e�e�Zedd �dd��ZG dd� de�Zdddd�dd�ZG dd� dee�ZdS )a& Contains command classes which may interact with an index / the network. Unlike its sister module, req_command, this module still uses lazy imports so commands which don't always hit the network (e.g. list w/o --outdated or --uptodate) don't need waste time importing PipSession and friends. � )�annotationsN)� lru_cache)�Values)� TYPE_CHECKING)�certifi)�Command)�CommandContextMixIn)� SSLContext�� PipSessionzSSLContext | None��returnc C s� t jdk rt�d� d S zdd l} W n tyB t�d� Y d S 0 zddlm} W n tyr t�d� Y d S 0 |� | j �}|�t� � � |S )N)� � z7Disabling truststore because Python version isn't 3.10+r z1Disabling truststore since ssl support is missing)� truststorez5Disabling truststore because platform isn't supported)�sys�version_info�logger�debug�ssl�ImportError�warning�pip._vendorr r �PROTOCOL_TLS_CLIENT�load_verify_locationsr �where)r r �ctx� r �I/usr/local/lib/python3.9/site-packages/pip/_internal/cli/index_command.py�_create_truststore_ssl_context s r c s` e Zd ZdZdd�� fdd�Zeddd�d d ��Zddd�dd �Zdddddd�dd�Z� Z S )�SessionCommandMixinzE A class mixin for command classes needing _build_session(). �Noner c s t � �� d | _d S )N)�super�__init__�_session)�self�� __class__r r r# ; s zSessionCommandMixin.__init__r zlist[str] | None��optionsr c C sL g }t |dd�s*t |dd�}|r*|�|� t |dd�}|rD|�|� |pJdS )z7Return a list of index urls from user-provided options.�no_indexF� index_urlN�extra_index_urls)�getattr�append�extend)�clsr) � index_urls�url�urlsr r r �_get_index_urls? s z#SessionCommandMixin._get_index_urlsr c C s0 | j du r*| �| �|��| _ | j dus*J �| j S )zGet a default-managed session.N)r$ � enter_context�_build_session)r% r) r r r �get_default_sessionM s z'SessionCommandMixin.get_default_sessionNz int | None)r) �retries�timeoutr c C s� ddl m} |j}|r&tj�|�s&J �d|jvr8t� }nd }||rPtj�|d�nd |d ur^|n|j |j | �|�|d�}|jr�|j|_ |jr�|j|_|js�|r�|d ur�|n|j|_|jr�|j|jd�|_d|_|j|_|j |j_|j|j_|S )Nr r zlegacy-certszhttp-v2)�cacher8 � trusted_hostsr1 �ssl_context)�http�httpsF)�pip._internal.network.sessionr � cache_dir�os�path�isabs�deprecated_features_enabledr �joinr8 r; r4 �cert�verify�client_certr9 �proxy�proxies� trust_envZ pip_proxy�no_input�auth� promptingZkeyring_provider)r% r) r8 r9 r r@ r<