
    'j2                    r   S SK Jr  S SKrS SKrS SK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Jr  S S
KJrJrJr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$  \(       a  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.  \R^                  " \05      r1 " S S5      r2 " S S5      r3g)    )annotationsN)IterableSequence)AbstractContextManager)nullcontext)StringIO)TYPE_CHECKING)Prefix)open_rich_spinneropen_spinner)BuildDependencyInstallErrorDiagnosticPipErrorInstallWheelBuildErrorPipError)get_environment)VERBOSEcapture_logging)get_runnable_pip)call_subprocess)TempDirectory)
WheelCache)PackageFinder)BuildTracker)InstallRequirement)BaseResolverc                  P    \ rS rSrSr S     SS jjr          S	S jrSrg)
#SubprocessBuildEnvironmentInstaller%   z<
Install build dependencies by calling pip in a subprocess.
Nc                0    Xl         U=(       d    / U l        g N)finder_build_constraints)selfr!   build_constraintss      Y/var/www/html/KUNJ/venv/lib/python3.13/site-packages/pip/_internal/build_env/installer.py__init__,SubprocessBuildEnvironmentInstaller.__init__*   s    
 "3"9r    c          
        U R                   n[        5       SSUR                  SSSSSS/
nUR                  (       a  UR	                  S	UR                  5        O1UR	                  S	[
        R                  5        UR                  S
5        [        R                  5       [        R                  ::  a  UR                  S5        O-[        R                  5       [        ::  a  UR                  S5        S Ha  n[        UR                  U5      nUR                  SUR!                  SS5      -   SR#                  [%        U=(       d    S15      5      45        Mc     UR&                  bI  UR&                  R)                  5        H+  u  pUR                  SU	R!                  SS5      -   U
45        M-     UR*                  nU(       a6  UR                  SUS	   /5        USS   H  nUR                  SU/5        M     OUR                  S5        UR,                   H  nUR                  SU/5        M     UR.                  b  UR                  SUR.                  /5        UR0                  (       a  UR                  S5        UR2                   H  nUR                  SU/5        M     UR4                  (       a  UR                  SUR4                  /5        UR6                  (       a  UR                  SUR6                  /5        UR8                  (       a  UR                  S5        UR:                  (       a,  UR                  SSR#                  UR:                  5      /5        U R<                   H  nUR                  SU/5        M     UR>                  (       a+  UR                  S UR>                  RA                  5       /5        UR                  S5        UR                  U5        U(       a   URB                  (       a  S!URB                   3OSn[E        S"U 35       n[G        US#U U 3US$S%0S&9  S S S 5        g ! , (       d  f       g = f)'Ninstallz--prefixz	--no-userz--no-warn-script-locationz--disable-pip-version-checkz--no-compilez--target r   z--ignore-installedz-vvz-v)	no_binaryonly_binaryz--_-,z:none:z-i   z--extra-index-urlz
--no-indexz--find-linksz--proxyz--no-proxy-envz--trusted-hostz--certz--client-certz--prefer-binaryz--refresh-packagez--build-constraintz--uploaded-prior-toz for Installing zinstalling  _PIP_IN_BUILD_IGNORE_CONSTRAINTS1)command_descspinnerextra_environ)$r!   r   pathvenv_executableinsertsys
executableappendloggergetEffectiveLevelloggingDEBUGr   getattrformat_controlextendreplacejoinsortedrelease_controlget_ordered_args
index_urls
find_linksproxyno_proxy_envtrusted_hostscustom_certclient_certprefer_binaryrefresh_packager"   uploaded_prior_to	isoformatnamer   r   )r#   requirementsprefixkindfor_reqr!   argsrC   formats	attr_namevaluerJ   extra_indexlinkhostconstraint_fileidentify_requirementr6   s                     r%   r*   +SubprocessBuildEnvironmentInstaller.install2   s     KK')  %
( !!KK6112KK3>>*KK,-##%6KK%%'72KK:Nf33^DGKK>11#s;;HHVG$9z:; ; !!- %+$:$:$K$K$M 	TI$5$5c3$??GH %N &&
KKz!}-.)!"~0+>?  . KK%%%DKK./ & <<#KKFLL12KK()((DKK)401 )KK6#5#567KK&*<*<=>KK)*!!KK,chhv7M7M.NOP  $66OKK-?@  7 ##KK.0H0H0R0R0TUVDL! '.',,eGLL>"B 	 Kv./7*4&1E0FGA3G	 0//s   P11
P?)r"   r!   r    )r!   r   r$   zlist[str] | NonereturnNone
rV   Iterable[str]rW   r
   rX   strrY   zInstallRequirement | Nonerd   re   )__name__
__module____qualname____firstlineno____doc__r&   r*   __static_attributes__ r(   r%   r   r   %   sh     /3:: ,: 
	:f#f f
 f +f 
fr(   r   c                  t    \ rS rSrSrSSS.           SS jjr          SS jrSS jrSS	 jrS
r	g)"InprocessBuildEnvironmentInstaller   a  
Install build dependencies via the already running pip process.

This contains a stripped down version of the install command with
only the logic necessary for installing build dependencies. The
finder, session, build tracker, and wheel cache are reused, but new
instances of everything else are created as needed.

Options are inherited from the parent install command unless
they don't make sense for build dependencies (in which case, they
are hard-coded, see comments below).
ro   r   )r$   	verbosityc                  SSK Jn  Xl        X@l        X0l        SU l        [        SSS9nU" S0 SU _SU_SUR                  R                  _S	UR                  _S
U_SU_SS_SS _SS_SS_SS_SS_SS_SS_SS_SS_6U l
        g )Nr   )RequirementPreparerzbuild-env-installT)rX   globally_managedbuild_isolation_installerr!   session	build_dirbuild_trackerrs   src_dirr+   download_dirbuild_isolationvirtualcheck_build_depsFprogress_baroffrequire_hashesuse_user_site
lazy_wheellegacy_resolverallow_editablesro   ) pip._internal.operations.prepareru   _finderr"   _wheel_cache_levelr   _link_collectorrx   r8   	_preparer)r#   r!   rz   wheel_cacher$   rs   ru   ry   s           r%   r&   +InprocessBuildEnvironmentInstaller.__init__   s     	I"3'!':TR	, 
&*
 
 **22	

  nn
 (
  
 
 
 &
 #
 
" !#
$  %
& '
( ")
* !+
r(   c               R   [         R                  [        5      (       + =(       a    U R                  S:H  nU(       a  [	        5       n[        SU 35      nO2[        [        5       5      [        5       pv[         R                  SU5         U =R                  S-  sl        U   U nU R                  X5        SSS5        SSS5        U =R                  S-  sl        g! , (       d  f       N,= f! , (       d  f       N5= f! [         as  n	[         R                  [        R                  " WR                  5       5      5        [         R                  SU	SS0S	9  [         R                  S
5        [        XAU	SS9eSn	A	f[          a  n	[        R                  " WR                  5       5      R#                  5       n
U(       dC  Sn
[%        U	[&        5      (       a  [         R                  SU	5        O[         R)                  S5        [        XAXS9eSn	A	ff = f! U =R                  S-  sl        f = f)z@Install entrypoint. Manages output capturing and error handling.r   r2   zInstalling %s ...r1   Nz%srichT)extrar+   )cause	log_lineszpip crashed unexpectedly)r>   isEnabledForr   r   r   r   r   r   info_install_implr   textwrapdedentgetvalueerrorr   	Exception
splitlines
isinstancer   	exception)r#   rV   rW   rX   rY   capture_logscapture_ctxr6   streamexclogss              r%   r*   *InprocessBuildEnvironmentInstaller.install   s    "..w77LDKK1<L 5D4EK,=D6>R,SG $/xz#:KMKK+T2	KK1K+""<8 &8 KK1K9 &+ " 	 KK(9:;LLs64.L9KKO-SD   	%-__V__5F%G%R%R%TD c8,,LLs+$$%?@-S 	 KK1Ksn   C< C+"C4C+<C< 
C(	$C++
C95C< 8H 9C< <
HA.E44HBHHH H&c                   SSK Jn  SSKJn  SSKJn  SSKJn  U Vs/ s H	  ou" USS9PM     nnUR                  U R                  5        U R                  5       n	U	R                  USS9n
U R                  R                  U
R                  R                  5       5        U
R                    Vs/ s H  oR"                  (       a  M  UPM     nnU" XR$                  SSS	9u  pU(       a  ['        U5      eU" U	R)                  U
5      UR*                  S
S
SSSSUR,                  S9	n[/        [1        UR2                  5      5      nU" UU5      =n(       a  [4        R7                  U5        g
g
s  snf s  snf )z$Core build dependency install logic.r   )installed_packages_summary)install_given_reqs)install_req_from_line)buildT)user_supplied)check_supported_wheels)verifyr   NFr   )rW   roothomewarn_script_locationr   	pycompiler   script_executable)pip._internal.commands.installr   pip._internal.reqr   pip._internal.req.constructorsr   pip._internal.wheel_builderr   rD   r"   _make_resolverresolver    prepare_linked_requirements_morerV   valuesrequirements_to_installis_wheelr   r   get_installation_orderr8   r9   r   listlib_dirsr>   r   )r#   rV   rW   r   r   r   r   reqireqsresolverresolved_setrreqs_to_buildr.   build_failures	installedenvsummarys                     r%   r   0InprocessBuildEnvironmentInstaller._install_impl
  sY   M8H5KWX<C&s$?<XT,,-&&(''d'K77%%,,.	

 $;;
;!::A; 	 
 ",,T4
 (88&++L9;;!& $44
	  d6??340C@@7@KK  AG Y
s   E'+E,E,c                x    SSK Jn  SSKJn  U" UU R                  U R
                  U R                  SSSSSSSSS9$ )	z'Create a new resolver for one time use.r   )install_req_from_req_string)ResolverFTzto-satisfy-onlyN)make_install_reqpreparerr!   r   ignore_requires_pythonr   ignore_dependenciesonly_dependenciesignore_installedforce_reinstallupgrade_strategypy_version_info)r   r   ,pip._internal.resolution.resolvelib.resolverr   r   r   r   )r#   r   r   s      r%   r   1InprocessBuildEnvironmentInstaller._make_resolver7  sJ     	OI8^^<<))#( %#!!. 
 	
r(   )r"   r   r   r   r   N)r!   r   rz   r   r   r   r$   zSequence[InstallRequirement]rs   intrd   re   rf   )rV   rg   rW   r
   rd   re   )rd   r   )
ri   rj   rk   rl   rm   r&   r*   r   r   rn   ro   r(   r%   rq   rq      s    . ;='
 '
 $	'

  '
 8'
 '
 
'
R2#2 2
 2 +2 
2h+!Z
r(   rq   )4
__future__r   r@   r;   r   collections.abcr   r   
contextlibr   ContextManagerr   ior   typingr	   pip._internal.build_env.baser
   pip._internal.cli.spinnersr   r   pip._internal.exceptionsr   r   r   r   pip._internal.metadatar   pip._internal.utils.loggingr   r   pip._internal.utils.miscr   pip._internal.utils.subprocessr   pip._internal.utils.temp_dirr   pip._internal.cacher   "pip._internal.index.package_finderr   ,pip._internal.operations.build.build_trackerr   pip._internal.req.req_installr   pip._internal.resolution.baser   	getLoggerri   r>   r   rq   ro   r(   r%   <module>r      s~    "  
  . ? "    / F  3 @ 5 : 6.@I@: 
		8	$s slr
 r
r(   