
    !2i5                       d Z ddlm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 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 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  ej8        e9          Z:d&dZ;e7j<        e7j=        e7j>        gZ? edd !          Z@d'd$ZA G d% d e          ZBdS )(zContains the RequirementCommand base class.

This class is in a separate module so the commands that do not always
need PackageFinder capability don't unnecessarily import the
PackageFinder machinery and all its vendored dependencies, etc.
    )annotationsN)partial)Values)AnyCallableTypeVar)#SubprocessBuildEnvironmentInstaller)
WheelCache)
cmdoptions)IndexGroupCommand)SessionCommandMixin)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_dependency_groups)parse_requirements)InstallRequirement)BaseResolver)TempDirectoryTempDirectoryTypeRegistrytempdir_kindsoptionsr   returnboolc                H    t           j                            d          dk    S )z
    Check if regular constraints should be ignored because
    we are in a isolated build process and build constraints
    feature is enabled but no build constraints were passed.
     _PIP_IN_BUILD_IGNORE_CONSTRAINTS1)osenvirongetr"   s    \/var/www/html/pixcura-vrs/venv/lib/python3.11/site-packages/pip/_internal/cli/req_command.py!should_ignore_regular_constraintsr-   0   s     :>><==DD    	_CommandTRequirementCommand)boundfunc-Callable[[_CommandT, Values, list[str]], int]c                      ddd fd}|S )zNDecorator for common logic related to managing temporary
    directories.
    registryr    r#   Nonec                F    t           D ]}|                     |d           d S )NF)KEEPABLE_TEMPDIR_TYPES
set_delete)r5   ts     r,   configure_tempdir_registryz0with_cleanup.<locals>.configure_tempdir_registryK   s4    ' 	* 	*A5))))	* 	*r.   selfr/   r"   r   args	list[str]intc                    | j         J |j        r | j                    	  | ||          S # t          $ r  | j                     w xY wN)tempdir_registryno_cleanr   )r<   r"   r=   r;   r2   s      r,   wrapperzwith_cleanup.<locals>.wrapperO   s~    $000 	>&&t'<===	4gt,,,$ 	 	 	 '&t'<===	s	   0 A)r5   r    r#   r6   )r<   r/   r"   r   r=   r>   r#   r?    )r2   rD   r;   s   ` @r,   with_cleanuprF   D   sB    * * * *       Nr.   c                       e Zd Zd3 fdZed4d
            Ze	 	 d5d6d            Ze	 	 	 	 	 	 	 d7d8d*            Zd9d-Z	ed:d.            Z
	 	 d;d<d2Z xZS )=r0   r=   r   kwr#   r6   c                     t                      j        |i | | j                            t	          j                               | j                            t	          j                               d S rA   )super__init__cmd_opts
add_optionr   dependency_groupsrC   )r<   r=   rH   	__class__s      r,   rK   zRequirementCommand.__init__a   sc    $%"%%%  !=!?!?@@@  !4!6!677777r.   r"   r   strc                    d| j         v rdS dS )zEDetermines which resolver should be used, based on the given options.zlegacy-resolverlegacy
resolvelib)deprecated_features_enabledr+   s    r,   determine_resolver_variantz-RequirementCommand.determine_resolver_variantg   s      CCC8|r.   Nr   temp_build_dirr   build_trackerr   sessionr   finderr   use_user_siter$   download_dir
str | None	verbosityr?   r   c	           
        |j         }	|	J d}
|                     |          }|dk    r&d|j        v }|rt                              d           n'd}
d}d|j        v rt                              d           t          |dg           }d	|j        v }t          di d
|	d|j        d|d|j        dt          |||          d|j
        d|d|d|j        d|d|j        d|d|d|d|
d|j        S )zQ
        Create a RequirementPreparer instance for the given parameters.
        NFrS   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.Tz;fast-deps has no effect when used with the legacy resolver.build_constraintszbuild-constraint	build_dirsrc_dirr[   build_isolationbuild_isolation_installer)r_    build_constraint_feature_enabledcheck_build_depsrW   rX   progress_barrY   require_hashesrZ   
lazy_wheelr]   legacy_resolverresume_retriesrE   )pathrU   features_enabledloggerwarninggetattrr   ra   rb   r	   re   rf   rg   rj   )clsrV   r"   rW   rX   rY   rZ   r[   r]   temp_build_dir_pathri   resolver_variantrh   r_   rd   s                  r,   make_requirement_preparerz,RequirementCommand.make_requirement_preparero   s    -1"...99'BB|++$(@@J "   #OJg666Q  
 $G-@"EE'":: 	) # 
 
 
))
OO
 &
 $33	

 'J"31Q' ' ' '
 %55
 (-
 G
 !--
 6
 #11
  (-!
" "z#
$  i%
& ,O'
( #11)
 	
r.   FTto-satisfy-onlypreparerwheel_cacheWheelCache | Noneignore_installedignore_requires_pythonforce_reinstallupgrade_strategypy_version_infotuple[int, ...] | Noner   c                b   t          t          |j                  }|                     |          }|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.
        )isolatedrS   r   N)ru   rY   rv   make_install_reqrZ   ignore_dependenciesrx   ry   rz   r{   r|   )r   r   isolated_moderU   ,pip._internal.resolution.resolvelib.resolver	_internal
resolutionrS   resolverResolverr   (pip._internal.resolution.legacy.resolverrR   )rp   ru   rY   r"   rv   rZ   rx   ry   rz   r{   r|   r   rr   pips                 r,   make_resolverz RequirementCommand.make_resolver   s    " #'*
 
 
 99'BB |++????=+6?HH!'!1+$+$?!1'= /!1 / I    	8777}'.7@@#-' ' ;-#9+-+ A 
 
 	
r.   r>   list[InstallRequirement]c                   g }t          |          sM|j        D ]E}t          |d|||          D ].}t          ||j        d          }|                    |           /F|D ]?}	t          |	d|j        dt          |dd                    }|                    |           @|j        rCt          |j                  D ].}	t          |	|j        d          }|                    |           /|j        D ]>}	t          |	d|j        t          |dd                    }|                    |           ?|j        D ]f}t          ||||	          D ]P}t          ||j        d|j        r|j                            d          nd
          }|                    |           Qgt!          d |D                       rd|_        |s|j        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)
constraintrY   r"   rX   F)r   user_suppliedNconfig_settings)
comes_fromr   r   r   )r   r   r   )rY   r"   rX   )r   r   r   c              3  $   K   | ]}|j         V  d S rA   )has_hash_options).0reqs     r,   	<genexpr>z6RequirementCommand.get_requirements.<locals>.<genexpr>5  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}")rE   )r-   constraintsr   r   r   appendr   ro   rN   r   r   	editablesr   requirementsr"   r*   anyrg   r   
find_linksr   formatdictjoin)r<   r=   r"   rY   rX   r   filename
parsed_req
req_to_addr   optss              r,   get_requirementsz#RequirementCommand.get_requirements   sV    24099 	4#/ 4 4"4#!### # # 4 4J "E"!(!6&+" " "J
 !''
33334  	, 	,C. ." '1BD I I  J 
++++$ 	0.w/HII 0 08$2"&  

 ##J////$ 	, 	,C2" . '1BD I I	  J 
++++  , 	0 	0H0'   0 0
 A$2"& &-"
*../@AAA!	 	 	
 ##J////0  <<|<<<<< 	*%)G" 	 	 #	 (		 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_locationsrm   info)rY   r   	locationss      r,   trace_basic_infoz#RequirementCommand.trace_basic_infoN  sG     * 88::	 	#KK	"""""	# 	#r.   target_pythonTargetPython | Nonebool | Nonec                    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_binaryry   )link_collectorselection_prefsr   )r   creater   r   prer   r   )r<   r"   rX   r   ry   r   r   s          r,   _build_package_finderz(RequirementCommand._build_package_finderY  si     '-gwGGG."1")+!/#9
 
 
 #)+'
 
 
 	
r.   )r=   r   rH   r   r#   r6   )r"   r   r#   rP   )Nr   )rV   r   r"   r   rW   r   rX   r   rY   r   rZ   r$   r[   r\   r]   r?   r#   r   )NFTFFrt   N)ru   r   rY   r   r"   r   rv   rw   rZ   r$   rx   r$   ry   r$   rz   r$   r{   rP   r|   r}   r#   r   )
r=   r>   r"   r   rY   r   rX   r   r#   r   )rY   r   r#   r6   )NN)
r"   r   rX   r   r   r   ry   r   r#   r   )__name__
__module____qualname__rK   staticmethodrU   classmethodrs   r   r   r   r   __classcell__)rO   s   @r,   r0   r0   `   s'       8 8 8 8 8 8    \  $(@
 @
 @
 @
 [@
D  *.#!%', % 1266
 6
 6
 6
 [6
pa a a aF # # # \# .2.2
 
 
 
 
 
 
 
 
r.   )r"   r   r#   r$   )r2   r3   r#   r3   )C__doc__
__future__r   loggingr(   	functoolsr   optparser   typingr   r   r   pip._internal.build_envr	   pip._internal.cacher
   pip._internal.clir   pip._internal.cli.index_commandr   r   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_dependency_groupr   pip._internal.req.req_filer   pip._internal.req.req_installr   pip._internal.resolution.baser   pip._internal.utils.temp_dirr   r    r!   	getLoggerr   rm   r-   	BUILD_ENVEPHEM_WHEEL_CACHE	REQ_BUILDr8   r/   rF   r0   rE   r.   r,   <module>r      s    # " " " " "  				             ) ) ) ) ) ) ) ) ) ) G G G G G G * * * * * * ( ( ( ( ( ( = = = = = = V V V V V V 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 @ @ @ @ @ @            K J J J J J 9 9 9 9 9 9 < < < < < < 6 6 6 6 6 6          
	8	$	$E E E E #  GK';<<<	   8S
 S
 S
 S
 S
* S
 S
 S
 S
 S
r.   