
    )i5                       S r SSKJr  SSKrSSKrSSKJr  SSKJr  SSK	J
r
JrJr  SSKJr  SSKJr  SS	KJr  SS
KJr  SSKJr  SSKJrJr  SSKJr  SSKJr  SSKJr  SSKJ r   SSK!J"r"  SSK#J$r$  SSK%J&r&  SSK'J(r(J)r)J*r*J+r+  SSK,J-r-  SSK.J/r/  SSK0J1r1  SSK2J3r3  SSK4J5r5J6r6J7r7  \Rp                  " \95      r:S S jr;\7Rx                  \7Rz                  \7R|                  /r?\" SSS9r@    S!S jrA " S S\5      rBg)"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_kindsc                F    [         R                  R                  S5      S:H  $ )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optionss    ]/var/www/html/land-doc-ocr/venv/lib/python3.13/site-packages/pip/_internal/cli/req_command.py!should_ignore_regular_constraintsr+   0   s     ::>><=DD    	_CommandTRequirementCommand)boundc                &   ^ ^ SS jmSUU 4S jjnU$ )zFDecorator for common logic related to managing temporary
directories.
c                B    [          H  nU R                  US5        M     g )NF)KEEPABLE_TEMPDIR_TYPES
set_delete)registryts     r*   configure_tempdir_registry0with_cleanup.<locals>.configure_tempdir_registryK   s    'A5) (r,   c                   > U R                   c   eUR                  (       a  T" U R                   5         T" XU5      $ ! [         a    T" U R                   5        e f = fN)tempdir_registryno_cleanr   )selfr)   argsr6   funcs      r*   wrapperwith_cleanup.<locals>.wrapperO   s`    $$000&t'<'<=	t,,$ 	 't'<'<=	s	   > A)r4   r    returnNone)r<   r-   r)   r   r=   	list[str]rA   int )r>   r?   r6   s   ` @r*   with_cleanuprF   D   s    *  Nr,   c                  $  ^  \ rS rSrS
U 4S jjr\SS j5       r\  S                 SS jj5       r\       S                     SS jj5       r	          SS jr
\SS j5       r  S         SS jjrS	rU =r$ )r.   `   c                   > [         TU ]  " U0 UD6  U R                  R                  [        R
                  " 5       5        U R                  R                  [        R                  " 5       5        g r9   )super__init__cmd_opts
add_optionr   dependency_groupsr;   )r<   r=   kw	__class__s      r*   rK   RequirementCommand.__init__a   sK    $%"%  !=!=!?@  !4!4!67r,   c                &    SU R                   ;   a  gg)zEDetermines which resolver should be used, based on the given options.zlegacy-resolverlegacy
resolvelib)deprecated_features_enabledr(   s    r*   determine_resolver_variant-RequirementCommand.determine_resolver_variantg   s      C CCr,   c	                4   UR                   n	U	c   eSn
U R                  U5      nUS:X  a,  SUR                  ;   nU(       a  [        R	                  S5        O)Sn
SnSUR                  ;   a  [        R	                  S5        [        US/ 5      nSUR                  ;   n[        S0 S	U	_S
UR                  _SU_SUR                  _S[        UUUS9_SUR                  _SU_SU_SUR                  _SU_SUR                  _SU_SU_SU_SU
_SUR                  _6$ )zA
Create a RequirementPreparer instance for the given parameters.
FrT   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_dirdownload_dirbuild_isolationbuild_isolation_installer)rY    build_constraint_feature_enabledcheck_build_depsbuild_trackersessionprogress_barfinderrequire_hashesuse_user_site
lazy_wheel	verbositylegacy_resolverresume_retriesrE   )pathrV   features_enabledloggerwarninggetattrr   r[   r]   r	   r`   rc   re   rj   )clstemp_build_dirr)   ra   rb   rd   rf   r\   rh   temp_build_dir_pathri   resolver_variantrg   rY   r_   s                  r*   make_requirement_preparer,RequirementCommand.make_requirement_preparero   s    -11"...99'B|+$(@(@@J" #OJg666Q
 $G-@"E'":":: 	) # 
)
OO
 &
 $33	

 'J"31Q'
 %55
 (
 
 !--
 
 #11
  (!
" "#
$  %
& ,'
( #11)
 	
r,   c                   [        [        UR                  S9nU R                  U5      nUS:X  aO  SSKnUR
                  R                  R                  R                  R                  UUUUUUR                  UUUU	U
S9$ SSKnUR
                  R                  R                  R                  R                  UUUUUUR                  UUUU	U
S9$ )z6
Create a Resolver instance for the given parameters.
)isolatedrT   r   N)preparerrd   wheel_cachemake_install_reqrf   ignore_dependenciesignore_installedignore_requires_pythonforce_reinstallupgrade_strategypy_version_info)r   r   isolated_moderV   ,pip._internal.resolution.resolvelib.resolver	_internal
resolutionrT   resolverResolverr{   (pip._internal.resolution.legacy.resolverrS   )rp   rx   rd   r)   ry   rf   r|   r}   r~   r   r   rz   rs   pips                 r*   make_resolver RequirementCommand.make_resolver   s    " #'**
 99'B |+?==++66??HH!'!1+$+$?$?!1'= /!1 / I   	8}}''..77@@#-' ' ; ;-#9+-+ A 
 	
r,   c                   / n[        U5      (       dM  UR                   H=  n[        USUUUS9 H)  n[        UUR                  SS9nUR                  U5        M+     M?     U H6  n	[        U	SUR                  S[        USS5      S9nUR                  U5        M8     UR                  (       aB  [        UR                  5       H)  n	[        U	UR                  SS9nUR                  U5        M+     UR                   H5  n	[        U	SUR                  [        USS5      S9nUR                  U5        M7     UR                   Hg  n[        XcX$S	9 HV  n[        UUR                  SUR                  (       a  UR                  R                  S5      OSS
9nUR                  U5        MX     Mi     [!        S U 5       5      (       a  SUl        U(       d  UR                  (       d  UR                  (       d  UR                  (       dv  SU R$                  0n
UR&                  (       a<  [)        SR*                  " S0 [-        U
SR/                  UR&                  5      S9D65      e[)        SR*                  " S0 U
D65      eU$ )zC
Parse command-line arguments into the corresponding requirements.
T)
constraintrd   r)   rb   F)rw   user_suppliedNconfig_settings)
comes_fromrw   r   r   )r   rw   r   )rd   r)   rb   )rw   r   r   c              3  8   #    U  H  oR                   v   M     g 7fr9   )has_hash_options).0reqs     r*   	<genexpr>6RequirementCommand.get_requirements.<locals>.<genexpr>5  s     <|##|s   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'   anyre   r   
find_linksr   formatdictjoin)r<   r=   r)   rd   rb   r   filename
parsed_req
req_to_addr   optss              r*   get_requirements#RequirementCommand.get_requirements   s    24099#//"4#!###J "E"!(!6!6&+"J
 !''
3# 0 C. .." '1BD IJ 
+  $$.w/H/HI8$22"&

 ##J/ J $$C2" .. '1BD I	J 
+ %  ,,H0
 A$22"& &-- #**../@A!	
 ##J/ -" <|<<<%)G"   ##((DII&D!!">>DfE t388G4F4F+GH  #..4f5 =7;= 
 r,   c                v    U R                   nUR                  5       nU(       a  [        R                  U5        gg)z5
Trace basic information about the provided objects.
N)search_scopeget_formatted_locationsrm   info)rd   r   	locationss      r*   trace_basic_info#RequirementCommand.trace_basic_infoN  s1     ** 88:	KK	" r,   c                    [         R                  " X!S9n[        SUR                  UR                  UR
                  US9n[        R                  " UUUS9$ )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_prefstarget_python)r   creater   r   prer   r   )r<   r)   rb   r   r}   r   r   s          r*   _build_package_finder(RequirementCommand._build_package_finderY  s[     '--gG."11")++!//#9
 ##)+'
 	
r,   rE   )r=   r   rO   r   rA   rB   )r)   r   rA   str)Nr   )rq   r   r)   r   ra   r   rb   r   rd   r   rf   boolr\   z
str | Nonerh   rD   rA   r   )NFTFFzto-satisfy-onlyN)rx   r   rd   r   r)   r   ry   zWheelCache | Nonerf   r   r|   r   r}   r   r~   r   r   r   r   ztuple[int, ...] | NonerA   r   )
r=   rC   r)   r   rd   r   rb   r   rA   zlist[InstallRequirement])rd   r   rA   rB   )NN)
r)   r   rb   r   r   zTargetPython | Noner}   zbool | NonerA   r   )__name__
__module____qualname____firstlineno__rK   staticmethodrV   classmethodrt   r   r   r   r   __static_attributes____classcell__)rP   s   @r*   r.   r.   `   s   8    $(@
%@
 @
 $	@

 @
 @
 @
 !@
 @
 
@
 @
D  *.#!%', % 1266
%6
 6
 	6

 '6
 6
 6
 !%6
 6
 6
 06
 
6
 6
paa a 	a
 a 
"aF # # .2.2

 
 +	

 !,
 

 
r,   )r)   r   rA   r   )r>   -Callable[[_CommandT, Values, list[str]], int]rA   r   )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_BUILDr2   r-   rF   r.   rE   r,   r*   <module>r      s    #  	   ) ) G * ( = V H 7 < E ; 4 E @  K 9 < 6  
		8	$E ##  K';<	
728S
* S
r,   