
    v.gF                     0   d 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	m
Z
mZmZ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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$ ddl%m&Z& ddl'm(Z(m)Z)m*Z*m+Z+ ddl,m-Z- ddl.m/Z/ ddl0m1Z1 ddl2m3Z3 ddl4m5Z5m6Z6m7Z7 ddl8m9Z9 e	rddl:m;Z;  ej<        e=          Z>ded         fdZ? G d de          Z@ G d d ee@          ZAe7jB        e7jC        e7jD        gZEd&d!ZFd"e
de
fd#ZG G d$ d%eA          ZHdS )'a  Contains the Command base classes that depend on PipSession.

The classes in this module are in a separate module so the commands not
needing download / PackageFinder capability don't unnecessarily import the
PackageFinder machinery and all its vendored dependencies, etc.
    N)partial)Values)TYPE_CHECKINGAnyListOptionalTuple)
WheelCache)
cmdoptions)Command)CommandContextMixIn)CommandErrorPreviousBuildDirError)LinkCollector)PackageFinder)SelectionPreferences)TargetPython)
PipSession)BuildTracker)RequirementPreparer)install_req_from_editableinstall_req_from_line#install_req_from_parsed_requirementinstall_req_from_req_string)parse_requirements)InstallRequirement)BaseResolver)pip_self_version_check)TempDirectoryTempDirectoryTypeRegistrytempdir_kinds)running_under_virtualenv)
SSLContextreturnr#   c                     t           j        dk     rt          d          	 dd l} n+# t          $ r t
                              d           Y d S w xY w	 dd l}n# t          $ r t          d          w xY w|                    | j	                  S )N)   
   z9The truststore feature is only available for Python 3.10+r   z1Disabling truststore since ssl support is missingz]To use the truststore feature, 'truststore' must be installed into pip's current environment.)
sysversion_infor   sslImportErrorloggerwarning
truststorer#   PROTOCOL_TLS_CLIENT)r*   r.   s     k/var/www/html/ws.service.destra.net.br/ws_env/lib/python3.11/site-packages/pip/_internal/cli/req_command.py_create_truststore_ssl_contextr1   2   s    
'!!VWWW



   JKKKtt
 
 
 
)
 
 	

   !8999s   & $AAA A1c                        e Zd ZdZd fdZededeee	                  fd            Z
dedefdZ	 	 	 dded	ee         d
ee         dedef
dZ xZS )SessionCommandMixinzE
    A class mixin for command classes needing _build_session().
    r$   Nc                 V    t                                                       d | _        d S N)super__init___session)self	__class__s    r0   r7   zSessionCommandMixin.__init__M   s$    .2    optionsc                     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        r0   _get_index_urlsz#SessionCommandMixin._get_index_urlsQ   s     
w
E22 	'';55C '!!#&&&w 2D99 	$d###!T!r;   c                     | j         6|                     |                     |                    | _         | j         J | j         S )zGet a default-managed session.)r8   enter_context_build_session)r9   r<   s     r0   get_default_sessionz'SessionCommandMixin.get_default_session_   sE    =  ..t/B/B7/K/KLLDM =,,,}r;   Fretriestimeoutfallback_to_certific                 @   |j         }|r!t          j                            |          sJ d|j        v r%	 t                      }n# t          $ r |s d }Y nw xY wd }t          |r t          j                            |d          nd ||n|j	        |j
        |                     |          |          }|j        r|j        |_        |j        r|j        |_        |j        s|r||n|j        |_        |j        r|j        |j        d|_        |j         |j        _        |S )Nr.   http)cacherM   trusted_hostsrE   ssl_context)rQ   https)	cache_dirospathisabsfeatures_enabledr1   	Exceptionr   joinrM   rS   rH   certverifyclient_certrN   proxyproxiesno_inputauth	prompting)r9   r<   rM   rN   rO   rV   rT   sessions           r0   rK   z"SessionCommandMixin._build_sessioni   sh    %	8i 8 88887333#<>> # # #* "#
 K5>H"',,y&111D&2GG!/++G44#
 
 
 < 	*$\GN  	/".GL ? 	Rg 	R)0)<gg'/GO = 	  GO &-%5!5s   A AAr$   N)NNF)__name__
__module____qualname____doc__r7   classmethodr   r   r   strrH   r   rL   intboolrK   __classcell__r:   s   @r0   r3   r3   G   s         3 3 3 3 3 3 "f "$s)1D " " " ["6 j     "&!%$)2 22 #2 #	2
 "2 
2 2 2 2 2 2 2 2r;   r3   c                   "    e Zd ZdZdeddf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$   Nc                     t          |d          sJ |j        s|j        rdS |                     |dt	          d|j                  d          }|5  t          ||           ddd           dS # 1 swxY w Y   dS )z
        Do the pip version check if not disabled.

        This overrides the default behavior of not doing the check.
        r>   Nr      T)rM   rN   rO   )hasattrdisable_pip_version_checkr>   rK   minrN   r   )r9   r<   re   s      r0   handle_pip_version_checkz*IndexGroupCommand.handle_pip_version_check   s     w
+++++, 	0@ 	F %%7?++
 !% & 	
 	
  	5 	5"7G444	5 	5 	5 	5 	5 	5 	5 	5 	5 	5 	5 	5 	5 	5 	5 	5 	5 	5s   A//A36A3)rg   rh   ri   rj   r   rx    r;   r0   rr   rr      s@         5 54 5 5 5 5 5 5r;   rr   c                      t                      rdS t          t          d          sdS t          j        dk    st          j        dk    rdS t          j                    dk    rdS t                              d           dS )zOutput a warning for sudo users on Unix.

    In a virtual environment, sudo pip still writes to virtualenv.
    On Windows, users may run pip as Administrator without issues.
    This warning only applies to Unix root users outside of virtualenv.
    Ngetuidwin32cygwinr   zRunning pip as the 'root' user can result in broken permissions and conflicting behaviour with the system package manager. It is recommended to use a virtual environment instead: https://pip.pypa.io/warnings/venv)r"   ru   rW   r(   platformr{   r,   r-   ry   r;   r0   warn_if_run_as_rootr      s      !! 2x    |w#,(":":	y{{a
NN	,    r;   funcc           	           dt           ddfddt          dt          dt          t                   dt
          t                   f fd}|S )	zNDecorator for common logic related to managing temporary
    directories.
    registryr$   Nc                 F    t           D ]}|                     |d           d S )NF)KEEPABLE_TEMPDIR_TYPES
set_delete)r   ts     r0   configure_tempdir_registryz0with_cleanup.<locals>.configure_tempdir_registry   s4    ' 	* 	*A5))))	* 	*r;   r9   r<   argsc                     | j         J |j        r | j                    	  | ||          S # t          $ r  | j                     w xY wr5   )tempdir_registryno_cleanr   )r9   r<   r   r   r   s      r0   wrapperzwith_cleanup.<locals>.wrapper   s     $000 	>&&t'<===	4gt,,,$ 	 	 	 '&t'<===	s	   0 A)r    RequirementCommandr   r   r   r   rm   )r   r   r   s   ` @r0   with_cleanupr      sy    
*-F *4 * * * * +19=c	#        Nr;   c                       e Zd Zdededdf fdZededefd            Ze		 	 d"d	e
ded
ededededee         dedefd            Ze		 	 	 	 	 	 	 	 d#dedededee         dedededededee         deeedf                  defd            Zdee         dedededee         f
dZededdfd            Z	 	 d$deded ee         dee         def
d!Z xZS )%r   r   kwr$   Nc                      t                      j        |i | | j                            t	          j                               d S r5   )r6   r7   cmd_opts
add_optionr   r   )r9   r   r   r:   s      r0   r7   zRequirementCommand.__init__  sD    $%"%%%  !4!6!677777r;   r<   c                     d| j         v rdS dS )zEDetermines which resolver should be used, based on the given options.zlegacy-resolverlegacy2020-resolver)deprecated_features_enabledr<   s    r0   determine_resolver_variantz-RequirementCommand.determine_resolver_variant  s      CCC8r;   r   temp_build_dirbuild_trackerre   finderuse_user_sitedownload_dir	verbosityc	                 N   |j         }	|	J |                     |          }
|
dk    r&d|j        v }|rt                              d           n%d}d|j        v rt                              d           t          |	|j        ||j        |j        |||j	        ||j
        |||          S )zQ
        Create a RequirementPreparer instance for the given parameters.
        Nr   z	fast-depszpip is using lazily downloaded wheels using HTTP range requests to obtain dependency information. This experimental feature is enabled through --use-feature=fast-deps and it is not ready for production.Fz;fast-deps has no effect when used with the legacy resolver.)	build_dirsrc_dirr   build_isolationcheck_build_depsr   re   progress_barr   require_hashesr   
lazy_wheelr   )rX   r   rZ   r,   r-   r   r   r   r   r   r   )rD   r   r<   r   re   r   r   r   r   temp_build_dir_pathresolver_variantr   s               r0   make_requirement_preparerz,RequirementCommand.make_requirement_preparer  s     -1"...99'BB..$(@@J "   Jg666Q   #)O%#3$5' -"1'!
 
 
 	
r;   FTto-satisfy-onlypreparerwheel_cacheignore_installedignore_requires_pythonforce_reinstallupgrade_strategy
use_pep517py_version_info.c                    t          t          |j        |
t          |dd                    }|                     |          }|dk    r=ddl}|j        j        j        j	        
                    ||||||j        ||||	|          S ddl}|j        j        j        j	        
                    ||||||j        ||||	|          S )zF
        Create a Resolver instance for the given parameters.
        config_settingsN)isolatedr   r   r   r   )r   r   r   make_install_reqr   ignore_dependenciesr   r   r   r   r   )r   r   isolated_moderA   r   ,pip._internal.resolution.resolvelib.resolver	_internal
resolution
resolvelibresolverResolverr   (pip._internal.resolution.legacy.resolverr   )rD   r   r   r<   r   r   r   r   r   r   r   r   r   r   pips                  r0   make_resolverz RequirementCommand.make_resolverD  s   $ #'*!#G->EE	
 
 
 99'BB ..????=+6?HH!'!1+$+$?!1'= /!1 / I    	8777}'.7@@#-' ' ;-#9+-+ A 
 
 	
r;   c                    g }|j         D ]E}t          |d|||          D ].}t          ||j        d          }|                    |           /F|D ]E}	t          |	d|j        |j        dt          |dd                    }|                    |           F|j        D ]D}	t          |	d|j        |j        t          |dd                    }|                    |           E|j
        D ]J}t          ||||	          D ]4}t          ||j        |j        d
          }|                    |           5Kt          d |D                       rd|_        |sy|j        sr|j
        skd| j        i}
|j        rAt           dj        di t#          |
d                    |j                                      t           dj        di |
          |S )zS
        Parse command-line arguments into the corresponding requirements.
        T)
constraintr   r<   re   F)r   user_suppliedNr   )r   r   r   r   )r   r   r   r   )r   r<   re   )r   r   r   c              3   $   K   | ]}|j         V  d S r5   )has_hash_options).0reqs     r0   	<genexpr>z6RequirementCommand.get_requirements.<locals>.<genexpr>  s%      <<s#<<<<<<r;   namezXYou must give at least one requirement to {name} (maybe you meant "pip {name} {links}"?) )linkszHYou must give at least one requirement to {name} (see "pip help {name}")ry   )constraintsr   r   r   rB   r   r   rA   	editablesr   requirementsanyr   r   
find_linksr   formatdictr\   )r9   r   r<   r   re   r   filename
parsed_req
req_to_addr   optss              r0   get_requirementsz#RequirementCommand.get_requirements  s    24+ 	0 	0H0   0 0
 A$2"'  

 ##J////0  		, 		,C. ."-" '1BD I I  J 
++++$ 	, 	,C2" ."- '1BD I I  J 
++++  , 
	0 
	0H0'   	0 	0
 A$2&1"&	  
 ##J////	0 <<|<<<<< 	*%)G" 	) 	W-A 	DI&D! "E >>D t388G4F+G+GHHH    #5 ..4= =7;= =  
 r;   c                 x    | j         }|                                }|rt                              |           dS dS )zE
        Trace basic information about the provided objects.
        N)search_scopeget_formatted_locationsr,   info)r   r   	locationss      r0   trace_basic_infoz#RequirementCommand.trace_basic_info  sG     * 88::	 	#KK	"""""	# 	#r;   target_pythonc                     t          j        ||          }t          d|j        |j        |j        |          }t          j        |||          S )z
        Create a package finder appropriate to this requirement command.

        :param ignore_requires_python: Whether to ignore incompatible
            "Requires-Python" values in links. Defaults to False.
        r   T)allow_yankedformat_controlallow_all_prereleasesprefer_binaryr   )link_collectorselection_prefsr   )r   creater   r   prer   r   )r9   r<   re   r   r   r   r   s          r0   _build_package_finderz(RequirementCommand._build_package_finder  si     '-gwGGG."1")+!/#9
 
 
 #)+'
 
 
 	
r;   )Nr   )NFTFFr   NN)NN)rg   rh   ri   r   r7   staticmethodr   rl   r   rk   r   r   r   r   rn   r   rm   r   r   r
   r	   r   r   r   r   r   r   r   r   ro   rp   s   @r0   r   r     s       8c 8 8 8 8 8 8 8 8
 F s    \  '+1
 1
%1
 1
 $	1

 1
 1
 1
 sm1
 1
 
1
 1
 1
 [1
f  -1#!%', % 1%)599
 9
%9
 9
 	9

 j)9
 9
 9
 !%9
 9
 9
 TN9
 "%S/29
 
9
 9
 9
 [9
vO3iO O 	O
 O 
 	!O O O Ob # #4 # # # \# 1515
 

 
  -	

 !)
 

 
 
 
 
 
 
 
r;   r   rf   )Irj   loggingrW   r(   	functoolsr   optparser   typingr   r   r   r   r	   pip._internal.cacher
   pip._internal.clir   pip._internal.cli.base_commandr   !pip._internal.cli.command_contextr   pip._internal.exceptionsr   r   pip._internal.index.collectorr   "pip._internal.index.package_finderr   $pip._internal.models.selection_prefsr   "pip._internal.models.target_pythonr   pip._internal.network.sessionr   ,pip._internal.operations.build.build_trackerr    pip._internal.operations.preparer   pip._internal.req.constructorsr   r   r   r   pip._internal.req.req_filer   pip._internal.req.req_installr   pip._internal.resolution.baser   !pip._internal.self_outdated_checkr   pip._internal.utils.temp_dirr   r    r!   pip._internal.utils.virtualenvr"   r*   r#   	getLoggerrg   r,   r1   r3   rr   	BUILD_ENVEPHEM_WHEEL_CACHE	REQ_BUILDr   r   r   r   ry   r;   r0   <module>r     sd     				 



             < < < < < < < < < < < < < < * * * * * * ( ( ( ( ( ( 2 2 2 2 2 2 A A A A A A H H H H H H H H 7 7 7 7 7 7 < < < < < < E E E E E E ; ; ; ; ; ; 4 4 4 4 4 4 E E E E E E @ @ @ @ @ @            : 9 9 9 9 9 < < < < < < 6 6 6 6 6 6 D D D D D D         
 D C C C C C 		8	$	$:(> : : : :*T T T T T- T T Tn 5  5  5  5  5!4  5  5  5H #    <s s    8t
 t
 t
 t
 t
* t
 t
 t
 t
 t
r;   