+
    TBiX:                     V   ^ RI t ^ RIt^ RIt^ RIt^ RIHt ^ RIHt ^ RIHt	 ^ RI
HtHtHt ^ RIHtHtHtHtHtHt ^RIHt ]'       d   ^ RIHt  ! R	 R
]4      tR R ltR R lt ! R R]4      t ! R R]4      t ! R R]4      tRR R lltRR R llt R R lt! ! R R4      t"R# )    N)contextmanager)abspath)join)STDOUT
check_callcheck_output)TYPE_CHECKINGAnyIteratorMappingOptionalSequence)_in_proc_script_path)Protocolc                   :   a  ] tR t^t o RtRV 3R lR lltRtV tR# )SubprocessRunnerz%A protocol for the subprocess runner.Nc          	      v   < V ^8  d   QhRS[ S[,          RS[S[,          RS[S[S[S[3,          ,          RR/#    cmdcwdextra_environreturnNr   strr   r   )format__classdict__s   ":/usr/lib/python3.14/site-packages/pyproject_hooks/_impl.py__annotate__SubprocessRunner.__annotate__   sI     	 	#	 #	 $GCH$56		
 	    c                    R # N )selfr   r   r   s   &&&&r   __call__SubprocessRunner.__call__   s     r!   r$   NN)__name__
__module____qualname____firstlineno____doc__r&   __static_attributes____classdictcell__r   s   @r   r   r      s     3	 	 	r!   r   c                V    V ^8  d   QhR\         \        \        3,          R\        RR/# )r   objpathr   N)r   r   r
   )r   s   "r   r   r      s*     $ $GCH% $S $t $r!   c                     \        VR RR7      ;_uu_ 4       p\        P                  ! W3/ VB  RRR4       R#   + '       g   i     R# ; i)wutf-8encodingN)openjsondump)r2   r3   kwargsfs   &&, r   
write_jsonr>      s3    	dC'	*	*a		##F# 
+	*	*	*s	   9A
	c                R    V ^8  d   QhR\         R\        \         \        3,          /# )r   r3   r   r   r   r
   )r   s   "r   r   r   !   s#      C GCH- r!   c                     \        V R R7      ;_uu_ 4       p\        P                  ! V4      uuRRR4       #   + '       g   i     R# ; i)r6   r7   N)r9   r:   load)r3   r=   s   & r   	read_jsonrC   !   s+    	dW	%	%yy| 
&	%	%	%s	   7A	c                   F   a a ] tR t^&t oRtRV3R lV 3R llltRtVtV ;t# )BackendUnavailablezEWill be raised if the backend cannot be imported in the hook process.c          
      v   < V ^8  d   QhRS[ RS[S[ ,          RS[S[ ,          RS[S[S[ ,          ,          RR/# )r   	tracebackmessagebackend_namebackend_pathr   Nr   r   r   )r   r   s   "r   r   BackendUnavailable.__annotate__)   sU     E EE #E sm	E
 x}-E 
Er!   c                ^   < W0n         W@n        Wn        \        ST `  T;'       g    R 4       R# )zError while importing backendN)rI   rJ   rG   super__init__)r%   rG   rH   rI   rJ   	__class__s   &&&&&r   rO   BackendUnavailable.__init__)   s,     )("CC$CDr!   )rI   rJ   rG   NNN	r)   r*   r+   r,   r-   rO   r.   r/   __classcell__rP   r   s   @@r   rE   rE   &   s     OE E Er!   rE   c                   B   a a ] tR t^7t oRtV3R lV 3R lltRtVtV ;t# )HookMissingz>Will be raised on missing hooks (if a fallback can't be used).c                $   < V ^8  d   QhRS[ RR/# )r   	hook_namer   Nr   )r   r   s   "r   r   HookMissing.__annotate__:   s     # ## #$ #r!   c                2   < \         SV `  V4       Wn        R # r#   )rN   rO   rY   )r%   rY   rP   s   &&r   rO   HookMissing.__init__:   s    #"r!   )rY   rS   rU   s   @@r   rW   rW   7   s     H# # #r!   rW   c                   6   a  ] tR t^?t o RtV 3R lR ltRtV tR# )UnsupportedOperationzDMay be raised by build_sdist if the backend indicates that it can't.c                $   < V ^8  d   QhRS[ RR/# )r   rG   r   NrZ   )r   r   s   "r   r   !UnsupportedOperation.__annotate__B   s     # ## #$ #r!   c                    Wn         R # r#   rG   )r%   rG   s   &&r   rO   UnsupportedOperation.__init__B   s    "r!   rc   N)r)   r*   r+   r,   r-   rO   r.   r/   r0   s   @r   r_   r_   ?   s     N# #r!   r_   c          	          V ^8  d   QhR\         \        ,          R\        \        ,          R\        \        \        \        3,          ,          RR/# r   r   )r   s   "r   r   r   F   sF     & &	#&	#& GCH-.& 
	&r!   c                    \         P                  P                  4       pV'       d   VP                  V4       \	        WVR7       R# )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   rg   s   &&& r   default_subprocess_runnerrm   F   s-     **//
C

=!s%r!   c          	          V ^8  d   QhR\         \        ,          R\        \        ,          R\        \        \        \        3,          ,          RR/# r   r   )r   s   "r   r   r   V   sF     7 7	#7	#7 GCH-.7 
	7r!   c                    \         P                  P                  4       pV'       d   VP                  V4       \	        WV\
        R7       R# )ziCall the subprocess while suppressing output.

This uses :func:`subprocess.check_output` under the hood.
)r   rg   stderrN)rh   ri   rj   rk   r   r   rl   s   &&& r   quiet_subprocess_runnerrq   V   s/     **//
C

=!3v6r!   c                <    V ^8  d   QhR\         R\         R\         /# )r   source_tree	requestedr   rZ   )r   s   "r   r   r   f   s!         r!   c                   \         P                  P                  V4      '       d   \        R4      h\         P                  P	                  V 4      p\         P                  P                  \         P                  P                  W!4      4      p\         P                  P                  V4      p\         P                  P                  V4      p\         P                  P                  WE.4      V8w  d   \        R4      hV# )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)	rh   r3   isabs
ValueErrorr   normpathr   normcasecommonprefix)rs   rt   
abs_sourceabs_requestednorm_sourcenorm_requesteds   &&    r   norm_and_checkr   f   s     
ww}}Y122-JGG$$RWW\\*%HIM ''"":.KWW%%m4N	ww[9:kI;<<r!   c                   *  a  ] tR t^~t o RtRV 3R lR llt]V 3R lR l4       tV 3R lR ltRV 3R	 lR
 llt	RV 3R lR llt
RV 3R lR lltRV 3R lR lltRV 3R lR lltRV 3R lR lltRV 3R lR lltRV 3R lR lltV 3R lR ltRtV tR# ) BuildBackendHookCallerzAA wrapper to call the build backend hooks for a source directory.Nc                z   < V ^8  d   QhRS[ RS[ RS[S[S[ ,          ,          RS[R,          RS[S[ ,          RR/# )	r   
source_dirbuild_backendrJ   runnerr   python_executabler   NrK   )r   r   s   "r   r   #BuildBackendHookCaller.__annotate__   sZ     3 33 3 x}-	3
 +,3 $C=3 
3r!   c                    Vf   \         p\        V4      V n        W n        V'       d&   V Uu. uF  p\	        V P                  V4      NK  	  ppW0n        W@n        V'       g   \        P                  pWPn	        R# u upi )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)
rm   r   r   r   r   rJ   _subprocess_runnersys
executabler   )r%   r   r   rJ   r   r   ps   &&&&&& r   rO   BuildBackendHookCaller.__init__   sg      >.F!*-*HTU1N4??A>LU("(  #!2 Vs   A:c                2   < V ^8  d   QhRRRS[ R,          /# )r   r   r   r   N)r   )r   r   s   "r   r   r      s      + +(: +x~ +r!   c              #  ^   "   V P                   pWn          Rx  W n         R#   Y n         i ; i5i)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)r   )r%   r   prevs   && r   subprocess_runner(BuildBackendHookCaller.subprocess_runner   s,      &&"(	+&*#d#s   -" -*-c                0   < V ^8  d   QhRS[ S[,          /# )r   r   )r   r   )r   r   s   "r   r   r      s     : :Xc] :r!   c                &    V P                  R/ 4      # )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!   c                \   < V ^8  d   QhRS[ S[S[S[3,          ,          RS[S[,          /# r   config_settingsr   r   r   r   r
   r   )r   r   s   "r   r   r      1     
 
!'#s("34
 
#
r!   c                *    V P                  RRV/4      # )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!   c                X   < V ^8  d   QhRS[ RS[S[S[ S[3,          ,          RS[RS[ /# r   metadata_directoryr   _allow_fallbackr   r   r   r   r
   bool)r   r   s   "r   r   r      sA     
 

 "'#s("34
 	

 

r!   c           	     D    V P                  RR\        V4      RVRV/4      # )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_wheelr   r   r   r   r   r%   r   r   r   s   &&&&r   r   7BuildBackendHookCaller.prepare_metadata_for_build_wheel   s2    0 .$g.@&A!?!?
 	
r!   c                h   < V ^8  d   QhRS[ RS[S[S[ S[3,          ,          RS[S[ ,          RS[ /# r   wheel_directoryr   r   r   r   r   r   r
   )r   r   s   "r   r   r      sE     
 

 "'#s("34
 %SM	

 

r!   c           	     b    Ve   \        V4      pV P                  RR\        V4      RVRV/4      # )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_wheelr   r   r   r   r   r%   r   r   r   s   &&&&r   r   "BuildBackendHookCaller.build_wheel   sD    * )!();!<!7?#;!?$&8
 	
r!   c                \   < V ^8  d   QhRS[ S[S[S[3,          ,          RS[S[,          /# r   r   )r   r   s   "r   r   r   	  r   r!   c                *    V P                  RRV/4      # )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          	      h   < V ^8  d   QhRS[ RS[S[S[ S[3,          ,          RS[RS[S[ ,          /# r   r   )r   r   s   "r   r   r     sE     
 

 "'#s("34
 	

 
#
r!   c           	     D    V P                  RR\        V4      RVRV/4      # )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   r   r   s   &&&&r   r   :BuildBackendHookCaller.prepare_metadata_for_build_editable  s2    . 1$g.@&A!?!?
 	
r!   c                h   < V ^8  d   QhRS[ RS[S[S[ S[3,          ,          RS[S[ ,          RS[ /# r   r   )r   r   s   "r   r   r   ;  sE     
 

 "'#s("34
 %SM	

 

r!   c           	     b    Ve   \        V4      pV P                  RR\        V4      RVRV/4      # )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   r   r   s   &&&&r   r   %BuildBackendHookCaller.build_editable;  sD    , )!();!<!7?#;!?$&8
 	
r!   c                \   < V ^8  d   QhRS[ S[S[S[3,          ,          RS[S[,          /# r   r   )r   r   s   "r   r   r   \  s1     

 

!'#s("34

 
#

r!   c                *    V P                  RRV/4      # )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!   c                R   < V ^8  d   QhRS[ RS[S[S[ S[3,          ,          RS[ /# )r   sdist_directoryr   r   r   )r   r   s   "r   r   r   h  s7     
 

 "'#s("34
 
	
r!   c                @    V P                  RR\        V4      RV/4      # )zqBuild an sdist from this project.

:returns:
    The name of the newly created sdist within ``wheel_directory``.
build_sdistr   r   r   )r%   r   r   s   &&&r   r   "BuildBackendHookCaller.build_sdisth  s,     !7?#;!?
 	
r!   c                B   < V ^8  d   QhRS[ RS[S[ S[3,          RS[/# )r   rY   r<   r   r@   )r   r   s   "r   r   r   z  s+      &  &C  &c1B  &s  &r!   c                   R V P                   /pV P                  '       d.   \        P                  P	                  V P                  4      pWCR&   \
        P                  ! 4       ;_uu_ 4       pRV/p\        V\        VR4      ^R7       \        4       ;_uu_ 4       pV P                  pV P                  V\        \        V4      4      W.V P                  VR7       RRR4       \        \        VR4      4      p	V	P!                  R4      '       d   \#        V	P!                  R	R
4      4      hV	P!                  R4      '       dD   \%        V	P!                  R	R
4      V	P!                  RR
4      V P                   V P                  R7      hV	P!                  R4      '       d%   \'        V	P!                  R4      ;'       g    T4      hV	R,          uuRRR4       #   + '       g   i     L; i  + '       g   i     R# ; i)_PYPROJECT_HOOKS_BUILD_BACKEND_PYPROJECT_HOOKS_BACKEND_PATHr<   z
input.json)indent)r   r   Nzoutput.jsonunsupportedrG    
no_backendbackend_error)rH   rI   rJ   hook_missingmissing_hook_name
return_val)r   rJ   rh   pathsepr   tempfileTemporaryDirectoryr>   pjoinr   r   r   r   r   r   rC   getr_   rE   rW   )
r%   rY   r<   r   rJ   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''!$((+>"?"L"L9MM%3 +*
 (' +**s9   +/G$A G	A%G$ AG$G$7G$G!G$$G5	)r   rJ   r   r   r   rR   r#   )NTr(   )r)   r*   r+   r,   r-   rO   r   r   r   r   r   r   r   r   r   r   r   r   r.   r/   r0   s   @r   r   r   ~   s     K3 3: + +&: :
 
$
 
B
 
@
 
$
 
@
 
B

 


 
$ &  &r!   r   r(   )#r:   rh   r   r   
contextlibr   os.pathr   r   r   
subprocessr   r   r   typingr	   r
   r   r   r   r   _in_processr   r   r   r>   rC   	ExceptionrE   rW   r_   rm   rq   r   r   r$   r!   r   <module>r      s     	 
  %  ! 7 7 L L -	8 	$

E E"#) ##9 #& 7 0\& \&r!   