
    hX:              
          S SK r S SK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Jr  S SKJrJrJrJrJrJr  SSKJr  \(       a  S S	KJr   " S
 S\5      rS\\\4   S\SS4S jrS\S\\\4   4S jr " S S\5      r " S S\5      r " S S\5      r  S!S\\   S\\   S\\\\4      SS4S jjr   S!S\\   S\\   S\\\\4      SS4S jjr!S\S\S\4S jr" " S S 5      r#g)"    N)contextmanager)abspath)join)STDOUT
check_callcheck_output)TYPE_CHECKINGAnyIteratorMappingOptionalSequence   )_in_proc_script_path)Protocolc            
       V    \ rS rSrSr  S
S\\   S\\   S\\\\4      SS4S jjr	S	r
g)SubprocessRunner   z%A protocol for the subprocess runner.Ncmdcwdextra_environreturnc                     g N )selfr   r   r   s       vC:\Users\ROHAN GUPTA\OneDrive\Desktop\mathbuddy-assessment\venv\Lib\site-packages\pip/_vendor/pyproject_hooks/_impl.py__call__SubprocessRunner.__call__   s         r   NN)__name__
__module____qualname____firstlineno____doc__r   strr   r   r   __static_attributes__r   r    r   r   r      sS    3
 "&9=		#	 #	 $GCH$56		
 	 	r    r   objpathr   c                 |    [        USSS9 n[        R                  " X40 UD6  S S S 5        g ! , (       d  f       g = f)Nwutf-8encoding)openjsondump)r)   r*   kwargsfs       r   
write_jsonr5      s-    	dC'	*a		##F# 
+	*	*s   -
;c                 x    [        U SS9 n[        R                  " U5      sS S S 5        $ ! , (       d  f       g = f)Nr-   r.   )r0   r1   load)r*   r4   s     r   	read_jsonr8   !   s%    	dW	%yy| 
&	%	%s   +
9c                   f   ^  \ rS rSrSr   SS\S\\   S\\   S\\\      SS4
U 4S	 jjjrS
r	U =r
$ )BackendUnavailable&   zEWill be raised if the backend cannot be imported in the hook process.N	tracebackmessagebackend_namebackend_pathr   c                 Z   > X0l         X@l        Xl        [        TU ]  U=(       d    S5        g )NzError while importing backend)r>   r?   r<   super__init__)r   r<   r=   r>   r?   	__class__s        r   rB   BackendUnavailable.__init__)   s)     )("C$CDr    )r>   r?   r<   NNN)r"   r#   r$   r%   r&   r'   r   r   rB   r(   __classcell__rC   s   @r   r:   r:   &   sc    O
 "&&*04EE #E sm	E
 x}-E 
E Er    r:   c                   8   ^  \ rS rSrSrS\SS4U 4S jjrSrU =r$ )HookMissing7   z>Will be raised on missing hooks (if a fallback can't be used).	hook_namer   Nc                 0   > [         TU ]  U5        Xl        g r   )rA   rB   rK   )r   rK   rC   s     r   rB   HookMissing.__init__:   s    #"r    )rK   )	r"   r#   r$   r%   r&   r'   rB   r(   rF   rG   s   @r   rI   rI   7   s    H## #$ # #r    rI   c                   *    \ rS rSrSrS\SS4S jrSrg)UnsupportedOperation?   zDMay be raised by build_sdist if the backend indicates that it can't.r<   r   Nc                     Xl         g r   r<   )r   r<   s     r   rB   UnsupportedOperation.__init__B   s    "r    rR   )r"   r#   r$   r%   r&   r'   rB   r(   r   r    r   rO   rO   ?   s    N## #$ #r    rO   r   r   r   c                     [         R                  R                  5       nU(       a  UR                  U5        [	        XUS9  g)zoThe default method of calling the wrapper subprocess.

This uses :func:`subprocess.check_call` under the hood.
)r   envN)osenvironcopyupdater   r   r   r   rU   s       r   default_subprocess_runnerr[   F   s-     **//
C

=!s%r    c                     [         R                  R                  5       nU(       a  UR                  U5        [	        XU[
        S9  g)ziCall the subprocess while suppressing output.

This uses :func:`subprocess.check_output` under the hood.
)r   rU   stderrN)rV   rW   rX   rY   r   r   rZ   s       r   quiet_subprocess_runnerr^   V   s/     **//
C

=!3v6r    source_tree	requestedc                    [         R                  R                  U5      (       a  [        S5      e[         R                  R	                  U 5      n[         R                  R                  [         R                  R                  X!5      5      n[         R                  R                  U5      n[         R                  R                  U5      n[         R                  R                  XE/5      U:w  a  [        S5      eU$ )zNormalise and check a backend path.

Ensure that the requested backend path is specified as a relative path,
and resolves to a location under the given source tree.

Return an absolute version of the requested path.
zpaths must be relativez paths must be inside source tree)	rV   r*   isabs
ValueErrorr   normpathr   normcasecommonprefix)r_   r`   
abs_sourceabs_requestednorm_sourcenorm_requesteds         r   norm_and_checkrk   f   s     
ww}}Y122-JGG$$RWW\\*%HIM ''"":.KWW%%m4N	ww[9:kI;<<r    c                   B   \ rS rSrSr   SS\S\S\\\      S\S   S	\\   S
S4S jjr\	SSS
\
S   4S j5       rS
\\   4S jr S S\\\\4      S
\\   4S jjr  S!S\S\\\\4      S\S
\4S jjr  S"S\S\\\\4      S\\   S
\4S jjr S S\\\\4      S
\\   4S jjr  S!S\S\\\\4      S\S
\\   4S jjr  S"S\S\\\\4      S\\   S
\4S jjr S S\\\\4      S
\\   4S jjr S S\S\\\\4      S
\4S jjrS\S\\\4   S
\4S jrSrg)#BuildBackendHookCaller~   zAA wrapper to call the build backend hooks for a source directory.N
source_dirbuild_backendr?   runnerr   python_executabler   c                     Uc  [         n[        U5      U l        X l        U(       a&  U Vs/ s H  n[	        U R                  U5      PM     nnX0l        X@l        U(       d  [        R                  nXPl	        gs  snf )a[  
:param source_dir: The source directory to invoke the build backend for
:param build_backend: The build backend spec
:param backend_path: Additional path entries for the build backend spec
:param runner: The :ref:`subprocess runner <Subprocess Runners>` to use
:param python_executable:
    The Python executable used to invoke the build backend
N)
r[   r   ro   rp   rk   r?   _subprocess_runnersys
executablerr   )r   ro   rp   r?   rq   rr   ps          r   rB   BuildBackendHookCaller.__init__   sg      >.F!*-*HTU1N4??A>LU("(  #!2 Vs    A7c              #   \   #    U R                   nXl          Sv   X l         g! X l         f = f7f)aA  A context manager for temporarily overriding the default
:ref:`subprocess runner <Subprocess Runners>`.

:param runner: The new subprocess runner to use within the context.

.. code-block:: python

    hook_caller = BuildBackendHookCaller(...)
    with hook_caller.subprocess_runner(quiet_subprocess_runner):
        ...
N)rt   )r   rq   prevs      r   subprocess_runner(BuildBackendHookCaller.subprocess_runner   s,      &&"(	+&*#d#s   ,! ,),c                 &    U R                  S0 5      $ )z>Return the list of optional features supported by the backend._supported_features
_call_hook)r   s    r   r~   *BuildBackendHookCaller._supported_features   s    4b99r    config_settingsc                 *    U R                  SSU05      $ )a=  Get additional dependencies required for building a wheel.

:param config_settings: The configuration settings for the build backend
:returns: A list of :pep:`dependency specifiers <508>`.

.. admonition:: Fallback

    If the build backend does not defined a hook with this name, an
    empty list will be returned.
get_requires_for_build_wheelr   r   r   r   s     r   r   3BuildBackendHookCaller.get_requires_for_build_wheel   s      *->,P
 	
r    metadata_directory_allow_fallbackc                 @    U R                  S[        U5      UUS.5      $ )a  Prepare a ``*.dist-info`` folder with metadata for this project.

:param metadata_directory: The directory to write the metadata to
:param config_settings: The configuration settings for the build backend
:param _allow_fallback:
    Whether to allow the fallback to building a wheel and extracting
    the metadata from it. Should be passed as a keyword argument only.

:returns: Name of the newly created subfolder within
          ``metadata_directory``, containing the metadata.

.. admonition:: Fallback

    If the build backend does not define a hook with this name and
    ``_allow_fallback`` is truthy, the backend will be asked to build a
    wheel via the ``build_wheel`` hook and the dist-info extracted from
    that will be returned.
 prepare_metadata_for_build_wheelr   r   r   r   r   r   r   r   r   s       r   r   7BuildBackendHookCaller.prepare_metadata_for_build_wheel   s,    0 .&-.@&A#2#2
 	
r    wheel_directoryc                 \    Ub  [        U5      nU R                  S[        U5      UUS.5      $ )a}  Build a wheel from this project.

:param wheel_directory: The directory to write the wheel to
:param config_settings: The configuration settings for the build backend
:param metadata_directory: The directory to reuse existing metadata from
:returns:
    The name of the newly created wheel within ``wheel_directory``.

.. admonition:: Interaction with fallback

    If the ``build_wheel`` hook was called in the fallback for
    :meth:`prepare_metadata_for_build_wheel`, the build backend would
    not be invoked. Instead, the previously built wheel will be copied
    to ``wheel_directory`` and the name of that file will be returned.
build_wheelr   r   r   r   r   r   r   r   r   s       r   r   "BuildBackendHookCaller.build_wheel   s=    * )!();!<#*?#;#2&8
 	
r    c                 *    U R                  SSU05      $ )aG  Get additional dependencies required for building an editable wheel.

:param config_settings: The configuration settings for the build backend
:returns: A list of :pep:`dependency specifiers <508>`.

.. admonition:: Fallback

    If the build backend does not defined a hook with this name, an
    empty list will be returned.
get_requires_for_build_editabler   r   r   s     r   r   6BuildBackendHookCaller.get_requires_for_build_editable	  s      -0A?/S
 	
r    c                 @    U R                  S[        U5      UUS.5      $ )a  Prepare a ``*.dist-info`` folder with metadata for this project.

:param metadata_directory: The directory to write the metadata to
:param config_settings: The configuration settings for the build backend
:param _allow_fallback:
    Whether to allow the fallback to building a wheel and extracting
    the metadata from it. Should be passed as a keyword argument only.
:returns: Name of the newly created subfolder within
          ``metadata_directory``, containing the metadata.

.. admonition:: Fallback

    If the build backend does not define a hook with this name and
    ``_allow_fallback`` is truthy, the backend will be asked to build a
    wheel via the ``build_editable`` hook and the dist-info
    extracted from that will be returned.
#prepare_metadata_for_build_editabler   r   r   s       r   r   :BuildBackendHookCaller.prepare_metadata_for_build_editable  s,    . 1&-.@&A#2#2
 	
r    c                 \    Ub  [        U5      nU R                  S[        U5      UUS.5      $ )a  Build an editable wheel from this project.

:param wheel_directory: The directory to write the wheel to
:param config_settings: The configuration settings for the build backend
:param metadata_directory: The directory to reuse existing metadata from
:returns:
    The name of the newly created wheel within ``wheel_directory``.

.. admonition:: Interaction with fallback

    If the ``build_editable`` hook was called in the fallback for
    :meth:`prepare_metadata_for_build_editable`, the build backend
    would not be invoked. Instead, the previously built wheel will be
    copied to ``wheel_directory`` and the name of that file will be
    returned.
build_editabler   r   r   s       r   r   %BuildBackendHookCaller.build_editable;  s=    , )!();!<#*?#;#2&8
 	
r    c                 *    U R                  SSU05      $ )zuGet additional dependencies required for building an sdist.

:returns: A list of :pep:`dependency specifiers <508>`.
get_requires_for_build_sdistr   r   r   s     r   r   3BuildBackendHookCaller.get_requires_for_build_sdist\  s      *->,P
 	
r    sdist_directoryc                 >    U R                  S[        U5      US.5      $ )zqBuild an sdist from this project.

:returns:
    The name of the newly created sdist within ``wheel_directory``.
build_sdist)r   r   r   )r   r   r   s      r   r   "BuildBackendHookCaller.build_sdisth  s(     #*?#;#2
 	
r    rK   r3   c           
         SU R                   0nU R                  (       a-  [        R                  R	                  U R                  5      nXCS'   [
        R                  " 5        nSU0n[        U[        US5      SS9  [        5        nU R                  nU R                  U[        [        U5      5      X/U R                  US9  S S S 5        [        [        US5      5      n	U	R!                  S	5      (       a  [#        U	R!                  S
S5      5      eU	R!                  S5      (       a@  [%        U	R!                  S
S5      U	R!                  SS5      U R                   U R                  S9eU	R!                  S5      (       a#  ['        U	R!                  S5      =(       d    U5      eU	S   sS S S 5        $ ! , (       d  f       N= f! , (       d  f       g = f)N_PYPROJECT_HOOKS_BUILD_BACKEND_PYPROJECT_HOOKS_BACKEND_PATHr3   z
input.json   )indent)r   r   zoutput.jsonunsupportedr<    
no_backendbackend_error)r=   r>   r?   hook_missingmissing_hook_name
return_val)rp   r?   rV   pathsepr   tempfileTemporaryDirectoryr5   pjoinr   rr   rt   r   r'   ro   r8   getrO   r:   rI   )
r   rK   r3   r   r?   td
hook_inputscriptpythondatas
             r   r   !BuildBackendHookCaller._call_hookz  s   94;M;MN::??4+<+<=L=I9:((*b"F+Jz5\#:1E &'6//''WS[19A"/ (  ( U2}56Dxx&&*488K+DEExx%%(HH["- HH_b9!%!3!3!%!2!2	  xx''!$((+>"?"L9MM%3 +*
 (' +*s%   "$F?=F.C!F?.
F<	8F??
G)rt   r?   rp   rr   ro   rE   r   )NTr!   )r"   r#   r$   r%   r&   r'   r   r   rB   r   r   r{   r~   r   r
   r   boolr   r   r   r   r   r   r   r   r(   r   r    r   rm   rm   ~   s   K 15/3+/33 3 x}-	3
 +,3 $C=3 
3: +(: +x~ + +&:Xc] : 8<
!'#s("34
 
#
* 8< $	

 "'#s("34
 	

 

H 8<,0	

 "'#s("34
 %SM	

 

D 8<
!'#s("34
 
#
* 8< $	

 "'#s("34
 	

 
#
F 8<,0	

 "'#s("34
 %SM	

 

F 8<

!'#s("34

 
#

 8<

 "'#s("34
 
	
$ &C  &c1B  &s  &r    rm   r!   )$r1   rV   ru   r   
contextlibr   os.pathr   r   r   
subprocessr   r   r   typingr	   r
   r   r   r   r   _in_processr   r   r   r'   r5   r8   	Exceptionr:   rI   rO   r[   r^   rk   rm   r   r    r   <module>r      sT    	 
  %  ! 7 7 L L -	8 	$GCH% $S $t $
C GCH- 
E E"#) ##9 # 15&	#&	#& GCH-.& 
	&$ 157	#7	#7 GCH-.7 
	7    0\& \&r    