
    'jJ                    h   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
  SSKJr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KJ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+  SSK,J-r-  SSK.J/r/J0r0J1r1J2r2J3r3  SSK4J5r5J6r6  SSK7J8r8  SSK9J:r:  SSK;J<r<  SSK=J>r>  SSK?J@r@  SSKAJBrBJCrC  SSKDJErEJFrFJGrG  \R                  " \I5      rJS&S jrK\GR                  \GR                  \GR                  /rO\" S S!S"9rP    S'S# jrQ          S(S$ jrR " S% S!\5      rSg))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)Callable)partial)Values)AnyTypeVar)BuildEnvironmentInstallerBuildIsolationMode"InprocessBuildEnvironmentInstaller#SubprocessBuildEnvironmentInstaller)
WheelCache)
cmdoptions)make_target_python)IndexGroupCommand)SessionCommandMixin)CommandErrorPreviousBuildDirErrorUnsupportedPythonVersion)LinkCollector)PackageFinder)SelectionPreferences)TargetPython)
PipSession)BuildTracker)RequirementPreparer)install_req_from_editableinstall_req_from_line#install_req_from_parsed_requirementinstall_req_from_pylock_packageinstall_req_from_req_string)PEP723Exceptionpep723_metadata)parse_dependency_groups)parse_requirements)InstallRequirement)BaseResolver)check_requires_python)is_valid_pylock_filenameselect_from_pylock_path_or_url)TempDirectoryTempDirectoryTypeRegistrytempdir_kindsc                 F    [         R                  R                  S5      S:H  $ )aO  
Whether this process should ignore the regular constraints it inherits.

The parent pip sets ``_PIP_IN_BUILD_IGNORE_CONSTRAINTS`` whenever it starts
an isolated build in a subprocess, so that regular constraints the build
inherits (such as via ``PIP_CONSTRAINT`` or config files) do not affect it.
Only build constraints apply there.
 _PIP_IN_BUILD_IGNORE_CONSTRAINTS1)osenvironget     U/var/www/html/KUNJ/venv/lib/python3.13/site-packages/pip/_internal/cli/req_command.py!should_ignore_regular_constraintsr6   B   s     ::>><=DDr4   	_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     r5   configure_tempdir_registry0with_cleanup.<locals>.configure_tempdir_registry`   s    'A5) (r4   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   )selfoptionsargsrA   funcs      r5   wrapperwith_cleanup.<locals>.wrapperd   s`    $$000&t'<'<=	t,,$ 	 't'<'<=	s	   > A)r?   r+   returnNone)rG   r7   rH   r   rI   	list[str]rM   intr3   )rJ   rK   rA   s   ` @r5   with_cleanuprQ   Y   s    *  Nr4   c           	         / nU  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$ )NT)
constraintfinderrH   sessionFisolateduser_supplied)r$   r   isolated_modeappend)constraint_filesrT   rH   rU   requirementsfilename
parsed_req
req_to_adds           r5   parse_constraint_filesr`   u   sd     L$,
J = ..#J
 
+
 % r4   c                  *  ^  \ rS rSrSU 4S jjr\SS j5       r\SS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$ )r8      c                   > [         TU ]  " U0 UD6  U R                  R                  [        R
                  " 5       5        U R                  R                  [        R                  " 5       5        g rD   )super__init__cmd_opts
add_optionr   dependency_groupsrF   )rG   rI   kw	__class__s      r5   re   RequirementCommand.__init__   sK    $%"%  !=!=!?@  !4!4!67r4   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_enabledrH   s    r5   determine_resolver_variant-RequirementCommand.determine_resolver_variant   s      C CCr4   Nr   )download_dir	verbosityc          	        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                  ;   a-  [        XX$5      n[        UUUU	[        UR                  5      S	9nO
[        UUS
9nUR                  (       d  SnO:SUR                  ;   a(  SnSUR                  ;   a  [        R	                  S5        OSn[        S 0 SU
_SUR                  _SU_SU_SU_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_6$ )!zA
Create a RequirementPreparer instance for the given parameters.
Frn   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inprocess-build-deps)rT   build_trackerrv   rt   wheel_cache)rv   offzvenv-isolationvenvzUsing --use-feature 'inprocess-build-deps' and 'venv-isolation' together is currently partially supported. If you encounter broken behaviour, use only one feature.virtual	build_dirsrc_dirrs   build_isolationbuild_isolation_installercheck_build_depsrw   rU   progress_barrT   require_hashesuse_user_site
lazy_wheelrt   legacy_resolverallow_editablesr3   )pathrq   features_enabledloggerwarninggetattrr`   r   r   	cache_dirr   r~   r   r}   r   r   r   )clstemp_build_dirrH   rw   rU   rT   r   r   rs   rt   temp_build_dir_pathr   resolver_variantr   rv   build_constraint_reqsenv_installerr~   s                     r5   make_requirement_preparer,RequirementCommand.make_requirement_preparer   s   " -11"...99'B|+$(@(@@J" #OJg666Q
 $G-@"E "W%=%==$:!7%! ?+"7#&w'8'89M @"3M
 &&27O!9!99$O%)A)AA? (O" 
)
OO
 &
 ,	

 '4
 %55
 (
 
 !--
 
 #11
 (
 "
  
 ,
  ,!
 	
r4   c                   [        [        UR                  S9nU R                  U5      nUS:X  aZ  SSKnUR
                  R                  R                  R                  R                  UUUUUUR                  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R                  UUUU	U
S9$ )z6
Create a Resolver instance for the given parameters.
)rW   rn   r   N)preparerrT   rx   make_install_reqr   ignore_dependenciesonly_dependenciesignore_installedignore_requires_pythonforce_reinstallupgrade_strategypy_version_info)r   r    rY   rq   ,pip._internal.resolution.resolvelib.resolver	_internal
resolutionrn   resolverResolverr   r   (pip._internal.resolution.legacy.resolverrm   )r   r   rT   rH   rx   r   r   r   r   r   r   r   r   pips                 r5   make_resolver RequirementCommand.make_resolver   s    " #'**
 99'B |+?==++66??HH!'!1+$+$?$?")";";!1'= /!1 / I   	8}}''..77@@#-' ' ; ;%77-#9+-+ A 
 	
r4   c                   / n[        5       (       a  [        US/ 5      nOUR                  n[        XcX$5      nUR	                  U5        U HM  nUR                  5       (       d  M  [        USUR                  S[        USS5      S9n	UR                  U	5        MO     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                   H  n
[        U
5      (       am  [         R#                  S5        [%        XS	9 HI  u  p['        UUU
SS
9u  pUR                  U	5        U(       d  M-  UR)                  UR*                  U5        MK     M  [-        XX$S9 HV  n[/        UUR                  SUR0                  (       a  UR0                  R3                  S5      OSS9n	UR                  U	5        MX     M     UR4                  (       a  [7        UR4                  5      S:  a  [9        S5      eUR4                  S   n [;        U5      nUR3                  SS5      nU(       aU  UR@                  (       dD  [C        U5      n[E        UURF                  S9(       d   [I        SU< SURJ                   SU< 35      eUR3                  S/ 5       H)  n[        UUR                  SS9n	UR                  U	5        M+     URL                  (       a  URN                  (       a  [9        S5      eURN                  (       d  [Q        S U 5       5      (       a  SUl&        U(       d  UR                  (       d  UR                  (       d  UR                  (       d  UR4                  (       dv  SU R*                  0nURR                  (       a<  [9        SRT                  " S0 [W        USRY                  URR                  5      S9D65      e[9        SRT                  " S0 UD65      eU$ ! [<         a  n[9        UR>                  5      eSnAff = f)zC
Parse command-line arguments into the corresponding requirements.
rv   NTconfig_settings)
comes_fromrW   rX   r   rV   )rX   rW   r   zUsing pylock.toml as a requirements source is an experimental feature. It may be removed/changed in a future release without prior warning.)rU   )rX   )rT   rH   rU   )rW   rX   r      z1--requirements-from-script can only be given oncer   zrequires-python )requires_pythonversion_infozScript z requires a different Python: z not in dependenciesz?--require-hashes and --no-require-hashes are mutually exclusivec              3  8   #    U  H  oR                   v   M     g 7frD   )has_hash_options).0reqs     r5   	<genexpr>6RequirementCommand.get_requirements.<locals>.<genexpr>  s      1
,8S  Ls   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}")r3   )-r6   r   constraintsr`   extendstripr   rY   rZ   rh   r#   r    	editablesr   r\   r(   r   r   r)   r   add_locked_linkr   r$   r   rH   r2   requirements_from_scriptslenr   r"   r!   msgr   r   r'   r   r   
py_versionr   no_require_hashesany
find_linksformatdictjoin)rG   rI   rH   rT   rU   r\   r[   r   r   r_   r]   packagepackage_distlocked_linkr^   scriptscript_metadataexcscript_requires_pythontarget_pythonoptss                        r5   get_requirements#RequirementCommand.get_requirements5  sG    24,..  'w0CRH&22,-=wXK(C99;;. .." '1BD IJ 
+  $$.w/H/HI8$22"&

 ##J/ J $$C2" .. '1BD I	J 
+ %  ,,H'11- .L.)G /N$ &*	/+J !''
3"{..w||[I. 0
 A$22"& &-- #**../@A!	
 ##J/+ -H ,,74459"#VWW66q9F,"1&"9 &5%8%89JB%O"%g.L.L 27 ;,$:!.!>!> 3!&+I(334H=S<VX 
 '**>2>8$22"&

 ##J/ ? !!g&?&?Q  ((S 1
,81
 .
 .
 &*G"   ##((00DII&D!!">>DfE t388G4F4F+GH  #..4f5 =7;= 
 w # ,"377++,s   -Q 
Q(Q##Q(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_locationsr   info)rT   r   	locationss      r5   trace_basic_info#RequirementCommand.trace_basic_info  s1     ** 88:	KK	" r4   c                    [         R                  " X!S9n[        SUR                  UR                  UR
                  US9n[        R                  " UUUUR                  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.
rp   T)allow_yankedformat_controlrelease_controlprefer_binaryr   )link_collectorselection_prefsr   uploaded_prior_to)r   creater   r   r   r   r   r   )rG   rH   rU   r   r   r   r   s          r5   _build_package_finder(RequirementCommand._build_package_finder  sf     '--gG."11#33!//#9
 ##)+'%77	
 	
r4   r3   )rI   r   ri   r   rM   rN   )rH   r   rM   str)r   r*   rH   r   rw   r   rU   r   rT   r   r   boolr   r   rs   z
str | Nonert   rP   rM   r   )NFTFFzto-satisfy-onlyN)r   r   rT   r   rH   r   rx   zWheelCache | Noner   r   r   r   r   r   r   r   r   r   r   ztuple[int, ...] | NonerM   r&   )
rI   rO   rH   r   rT   r   rU   r   rM   list[InstallRequirement])rT   r   rM   rN   r<   )
rH   r   rU   r   r   zTargetPython | Noner   r   rM   r   )__name__
__module____qualname____firstlineno__re   staticmethodrq   classmethodr   r   r   r   r   __static_attributes____classcell__)rj   s   @r5   r8   r8      s   8    $(Z
%Z
 Z
 $	Z

 Z
 Z
 Z
 Z
 !Z
 Z
 
Z
 Z
x  *.#!%', % 1268
%8
 8
 	8

 '8
 8
 8
 !%8
 8
 8
 08
 
8
 8
t[[ [ 	[
 [ 
"[z # # .2',

 
 +	

 !%
 

 
r4   )rM   r   )rJ   -Callable[[_CommandT, Values, list[str]], int]rM   r   )
r[   rO   rT   r   rH   r   rU   r   rM   r   )T__doc__
__future__r   loggingr0   collections.abcr   	functoolsr   optparser   typingr   r   pip._internal.build_envr	   r
   r   r   pip._internal.cacher   pip._internal.clir   pip._internal.cli.cmdoptionsr   pip._internal.cli.index_commandr   r   pip._internal.exceptionsr   r   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   r    pip._internal.req.pep723r!   r"   &pip._internal.req.req_dependency_groupr#   pip._internal.req.req_filer$   pip._internal.req.req_installr%   pip._internal.resolution.baser&   pip._internal.utils.packagingr'   pip._internal.utils.pylockr(   r)   pip._internal.utils.temp_dirr*   r+   r,   	getLoggerr   r   r6   	BUILD_ENVEPHEM_WHEEL_CACHE	REQ_BUILDr=   r7   rQ   r`   r8   r3   r4   r5   <module>r     s.   #  	 $     + ( ; = V 
 8 < E ; 4 E @  F J 9 < 6 ?  
		8	$
E ##  K';<	
728  	
 2j
* j
r4   