§
    �’j)  ã                  ó8  — d Z ddlmZ ddlZddlZddlZddlmZ ddlm	Z	 ddl
mZ ddlmZ ddlmZ dd	lmZ dd
lmZ erddlmZ ddlmZ ddlmZ ddlmZ  ej        e¦  «        Ze	dd„¦   «         Z G d„ de¦  «        Z d d„Z!d!d„Z" G d„ dee ¦  «        Z#dS )"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)ÚIterator)Ú	lru_cache)ÚValues)ÚTYPE_CHECKING)Úcertifi)ÚCommand)ÚCommandContextMixIn)Ú
SSLContext)ÚNormalizedName©Ú
PipSession)ÚUpgradePromptÚreturnúSSLContext | Nonec                 óN  — 	 dd l } n+# t          $ r t                               d¦  «         Y d S w xY w	 ddlm} n+# t          $ r t                               d¦  «         Y d S w xY w|                     | j        ¦  «        }|                     t          j
        ¦   «         ¦  «         |S )Nr   z1Disabling truststore since ssl support is missing)Ú
truststorez5Disabling truststore because platform isn't supported)ÚsslÚImportErrorÚloggerÚwarningÚpip._vendorr   r   ÚPROTOCOL_TLS_CLIENTÚload_verify_locationsr   Úwhere)r   r   Úctxs      úMC:\Projects\DSCons\.venv\Lib\site-packages\pip\_internal\cli\index_command.pyÚ_create_truststore_ssl_contextr   #   sÍ   € ðØˆ
ˆ
ˆ
ˆ
øÝð ð ð Ý�ŠÐJÑKÔKÐKØˆtˆtðøøøðØ*Ð*Ð*Ð*Ð*Ð*Ð*øÝð ð ð Ý�ŠÐNÑOÔOÐOØˆtˆtðøøøð ×
Ò
 Ô 7Ñ
8Ô
8€CØ×Ò�gœm™oœoÑ.Ô.Ð.Ø€Js   ‚ ‡$/®/³: º$A"Á!A"c                  óR   ‡ — e Zd ZdZdˆ fd„Zedd„¦   «         Zdd
„Z	 	 ddd„Zˆ xZ	S )ÚSessionCommandMixinzE
    A class mixin for command classes needing _build_session().
    r   ÚNonec                óV   •— t          ¦   «                              ¦   «          d | _        d S )N)ÚsuperÚ__init__Ú_session)ÚselfÚ	__class__s    €r   r$   zSessionCommandMixin.__init__;   s$   ø€ Ý‰Œ×ÒÑÔÐØ+/ˆŒˆˆó    Úoptionsr   úlist[str] | Nonec                óÐ   — g }t          |dd¦  «        s(t          |dd¦  «        }|r|                     |¦  «         t          |dd¦  «        }|r|                     |¦  «         |pdS )z7Return a list of index urls from user-provided options.Úno_indexFÚ	index_urlNÚextra_index_urls)ÚgetattrÚappendÚextend)Úclsr)   Ú
index_urlsÚurlÚurlss        r   Ú_get_index_urlsz#SessionCommandMixin._get_index_urls?   sƒ   € ð ˆ
Ý�w 
¨EÑ2Ô2ð 	'Ý˜' ;°Ñ5Ô5ˆCØð 'Ø×!Ò! #Ñ&Ô&Ð&Ý�wÐ 2°DÑ9Ô9ˆØð 	$Ø×Ò˜dÑ#Ô#Ð#àÐ!˜TÐ!r(   r   c                óŠ   — | j         €6|                      |                      |¦  «        ¦  «        | _         | j         €J ‚| j         S )zGet a default-managed session.)r%   Úenter_contextÚ_build_session)r&   r)   s     r   Úget_default_sessionz'SessionCommandMixin.get_default_sessionM   sE   € àŒ=Ð Ø ×.Ò.¨t×/BÒ/BÀ7Ñ/KÔ/KÑLÔLˆDŒMð ”=Ð,Ð,Ð,ØŒ}Ðr(   NÚretriesú
int | NoneÚtimeoutc                óØ  — ddl m} |j        }|r!t          j                             |¦  «        sJ ‚d|j        vrt          ¦   «         }nd } ||r t          j                             |d¦  «        nd |�|n|j	        |j
        |j        |                      |¦  «        |t          |dt          ¦   «         ¦  «        ¬¦  «        }|j        r|j        |_        |j        r|j        |_        |j        s|r|�|n|j        |_        |j        €|j        r:|j        r|j        |j        dœ|_        d|_        |j        |_        |j        |_        |j         |j        _        |j        |j        _        |S )	Nr   r   zlegacy-certszhttp-v2Úrefresh_package)Úcacher;   Úresume_retriesÚtrusted_hostsr3   Ússl_contextr?   )ÚhttpÚhttpsF)Úpip._internal.network.sessionr   Ú	cache_dirÚosÚpathÚisabsÚdeprecated_features_enabledr   Újoinr;   rA   rB   r6   r/   ÚsetÚcertÚverifyÚclient_certr=   ÚproxyÚno_proxy_envÚproxiesÚ	trust_envÚ	pip_proxyÚpip_no_proxy_envÚno_inputÚauthÚ	promptingÚkeyring_provider)r&   r)   r;   r=   r   rG   rC   Úsessions           r   r9   z"SessionCommandMixin._build_sessionW   sœ  € ð 	=Ð<Ð<Ð<Ð<Ð<àÔ%ˆ	ØÐ8¥¤§¢¨iÑ 8Ô 8Ð8Ð8Ð8à Ô!DÐDÐDÝ8Ñ:Ô:ˆKˆKàˆKà�*Ø8AÐK•"”'—,’,˜y¨)Ñ4Ô4Ð4ÀtØ&Ð2�G�G¸¼Ø"Ô1Ø!Ô/Ø×+Ò+¨GÑ4Ô4Ø#Ý# GÐ->ÅÁÄÑFÔFð
ñ 
ô 
ˆð Œ<ð 	*Ø$œ\ˆGŒNð Ôð 	/Ø"Ô.ˆGŒLð Œ?ð 	R˜gð 	RØ)0Ð)<˜g˜gÀ'Ä/ˆGŒOð Œ=Ð$¨Ô(<Ð$ØŒ}ð à#œMØ$œ]ð#ð #�”ð !&ˆGÔà '¤ˆGÔØ'.Ô';ˆGÔ$ð &-Ô%5Ð!5ˆŒÔØ(/Ô(@ˆŒÔ%àˆr(   )r   r!   )r)   r   r   r*   )r)   r   r   r   )NN)r)   r   r;   r<   r=   r<   r   r   )
Ú__name__Ú
__module__Ú__qualname__Ú__doc__r$   Úclassmethodr6   r:   r9   Ú__classcell__)r'   s   @r   r    r    6   sœ   ø€ € € € € ðð ð0ð 0ð 0ð 0ð 0ð 0ð ð"ð "ð "ñ „[ð"ðð ð ð ð #Ø"ð	7ð 7ð 7ð 7ð 7ð 7ð 7ð 7ð 7r(   r    r[   r   r)   r   úUpgradePrompt | Nonec                ó&   — ddl m}  || |¦  «        S )Nr   )Úpip_self_version_check_fetch)Ú!pip._internal.self_outdated_checkrd   )r[   r)   rd   s      r   Ú_pip_self_version_check_fetchrf   ‘   s*   € ð OÐNÐNÐNÐNÐNà'Ð'¨°Ñ9Ô9Ð9r(   Úupgrade_promptr!   c                ó(   — ddl m}  || ¦  «         d S )Nr   )Úpip_self_version_check_emit)re   ri   )rg   ri   s     r   Ú_pip_self_version_check_emitrj   ™   s+   € ØMÐMÐMÐMÐMÐMàÐ Ñ/Ô/Ð/Ð/Ð/r(   c                  ó<   — e Zd ZdZdd„Zej        dd„¦   «         ZdS )ÚIndexGroupCommandz–
    Abstract base class for commands with the index_group options.

    This also corresponds to the commands that permit the pip version check.
    r)   r   Úpackage_namer   r   Úboolc                ó`   — |j         r&|j                              |¦  «        }|du rdS |du rdS dS )zM
        Determine if pre-releases should be excluded for a package.
        TF)Úrelease_controlÚallows_prereleases)r&   r)   rm   Úallow_prereleasess       r   Úshould_exclude_prereleasez+IndexGroupCommand.should_exclude_prerelease¦   sM   € ð Ô"ð 	Ø 'Ô 7× JÒ JÈ<Ñ XÔ XÐØ  DÐ(Ð(Ø�uØ" eÐ+Ð+Ø�tð ˆtr(   Úargsú	list[str]úIterator[None]c              #  ó  K  — t          |d¦  «        sJ ‚|j        s|j        rdV — dS d}	 |                      |dt	          d|j        ¦  «        ¬¦  «        }|5  t          ||¦  «        }ddd¦  «         n# 1 swxY w Y   nF# t          $ r9 t           	                    d¦  «         t           
                    dd¬	¦  «         Y nw xY w	 dV — 	 t          |¦  «         dS # t          $ r: t           	                    d¦  «         t           
                    dd¬	¦  «         Y dS w xY w# 	 t          |¦  «         w # t          $ r9 t           	                    d¦  «         t           
                    dd¬	¦  «         Y w w xY wxY w)
z€
        Do the pip version check if not disabled.

        This overrides the default behavior of not doing the check.
        r,   Nr   é   )r;   r=   z6There was an error checking the latest version of pip.zSee below for errorT)Úexc_info)ÚhasattrÚdisable_pip_version_checkr,   r9   Úminr=   rf   Ú	Exceptionr   r   Údebugrj   )r&   r)   rt   rg   r[   s        r   Úpip_version_checkz#IndexGroupCommand.pip_version_check·   s(  è è € õ �w 
Ñ+Ô+Ð+Ð+Ð+àÔ,ð 	°Ô0@ð 	ØˆEˆEˆEØˆFà/3ˆð
	?Ø×)Ò)ØØÝ˜A˜wœÑ/Ô/ð *ñ ô ˆGð
 ð Qð QÝ!>¸wÈÑ!PÔ!P�ðQð Qð Qñ Qô Qð Qð Qð Qð Qð Qð Qøøøð Qð Qð Qð Qøøåð 	?ð 	?ð 	?Ý�NŠNÐSÑTÔTÐTÝ�LŠLÐ.¸ˆLÑ>Ô>Ð>Ð>Ð>ð	?øøøð	CØˆEˆEˆEðCÝ,¨^Ñ<Ô<Ð<Ð<Ð<øÝð Cð Cð CÝ—’ÐWÑXÔXÐXÝ—’Ð2¸T�ÑBÔBÐBÐBÐBÐBðCøøøøðCÝ,¨^Ñ<Ô<Ð<Ð<øÝð Cð Cð CÝ—’ÐWÑXÔXÐXÝ—’Ð2¸T�ÑBÔBÐBÐBÐBðCøøøøøøsz   ¬-B ÁA6Á*B Á6A:Á:B Á=A:Á>B ÂA CÃCÃ	D& ÃC ÃA D#Ä"D#Ä&E>Ä(D8Ä7E>Ä8A E;Å8E>Å:E;Å;E>N)r)   r   rm   r   r   rn   )r)   r   rt   ru   r   rv   )r\   r]   r^   r_   rs   Ú
contextlibÚcontextmanagerr   © r(   r   rl   rl   Ÿ   s\   € € € € € ðð ðð ð ð ð" Ôð!Cð !Cð !Cñ Ôð!Cð !Cð !Cr(   rl   )r   r   )r[   r   r)   r   r   rb   )rg   rb   r   r!   )$r_   Ú
__future__r   r€   ÚloggingrH   Úcollections.abcr   Ú	functoolsr   Úoptparser   Útypingr   r   r   Úpip._internal.cli.base_commandr	   Ú!pip._internal.cli.command_contextr
   r   r   Úpip._vendor.packaging.utilsr   rF   r   re   r   Ú	getLoggerr\   r   r   r    rf   rj   rl   r‚   r(   r   ú<module>r�      sß  ððð ð #Ð "Ð "Ð "Ð "Ð "à Ð Ð Ð Ø €€€Ø 	€	€	€	Ø $Ð $Ð $Ð $Ð $Ð $Ø Ð Ð Ð Ð Ð Ø Ð Ð Ð Ð Ð Ø  Ð  Ð  Ð  Ð  Ð  à Ð Ð Ð Ð Ð à 2Ð 2Ð 2Ð 2Ð 2Ð 2Ø AÐ AÐ AÐ AÐ AÐ Aàð @ØÐÐÐÐÐà:Ð:Ð:Ð:Ð:Ð:à8Ð8Ð8Ð8Ð8Ð8Ø?Ð?Ð?Ð?Ð?Ð?à	ˆÔ	˜8Ñ	$Ô	$€ð ðð ð ñ „ðð$Xð Xð Xð Xð XÐ-ñ Xô Xð Xðv:ð :ð :ð :ð0ð 0ð 0ð 0ð:Cð :Cð :Cð :Cð :C˜Ð!4ñ :Cô :Cð :Cð :Cð :Cr(   