Ë
    ^Qêj¤=  ã            
       óÖ  — d dl Z d dlZd dlZd dlZd dlZd dlmZ d dlmZ d dlm	Z
 d dlmZmZmZmZmZmZ d dlZddlmZ erd dlmZ  G d	„ d
e«      Zdeeef   deddfd„Zdedeeef   fd„Z G d„ de«      Z G d„ de«      Z G d„ de«      Z G d„ de«      Z	 	 d"dee   dee   deeeef      ddfd„Z 	 	 d"dee   dee   deeeef      ddfd„Z!dededefd„Z" G d „ d!«      Z#y)#é    N)Úcontextmanager)Úabspath)Újoin)ÚTYPE_CHECKINGÚAnyÚIteratorÚMappingÚOptionalÚSequenceé   )Ú_in_proc_script_path)ÚProtocolc            
       óJ   — e Zd ZdZ	 	 ddee   dee   deeeef      ddfd„Zy)	ÚSubprocessRunnerz%A protocol for the subprocess runner.NÚcmdÚcwdÚextra_environÚreturnc                  ó   — y ©N© )Úselfr   r   r   s       úZ/home/oem/CyberBrain26-unified/.venv/lib/python3.12/site-packages/pyproject_hooks/_impl.pyÚ__call__zSubprocessRunner.__call__   s   € ð ó    ©NN)	Ú__name__Ú
__module__Ú__qualname__Ú__doc__r   Ústrr
   r	   r   r   r   r   r   r      sN   „ Ù3ð
 "&Ø9=ñ		à˜#‘ð	ð ˜#‘ð	ð $ G¨C°¨HÑ$5Ñ6ð		ð
 ô	r   r   ÚobjÚpathr   c                 óx   — t        |dd¬«      5 }t        j                  | |fi |¤Ž d d d «       y # 1 sw Y   y xY w)NÚwúutf-8©Úencoding)ÚopenÚjsonÚdump)r"   r#   ÚkwargsÚfs       r   Ú
write_jsonr.      s8   € Ü	ˆd�C 'Ô	*ð $¨aÜ�	‰	�#�qÑ#˜FÒ#÷$÷ $ñ $ús   �0°9c                 ór   — t        | d¬«      5 }t        j                  |«      cd d d «       S # 1 sw Y   y xY w)Nr&   r'   )r)   r*   Úload)r#   r-   s     r   Ú	read_jsonr1   "   s.   € Ü	ˆd˜WÔ	%ð ¨Ü�y‰y˜‹|÷÷ ò ús   Ž-­6c                   ó   — e Zd ZdZy)ÚBuildBackendWarningzBWill be emitted for every UserWarning emitted by the hook process.N)r   r   r   r    r   r   r   r3   r3   '   s   „ ÚLr   r3   c                   óX   ‡ — e Zd ZdZ	 	 	 d	dedee   dee   deee      ddf
ˆ fd„Zˆ xZS )
ÚBackendUnavailablezEWill be raised if the backend cannot be imported in the hook process.NÚ	tracebackÚmessageÚbackend_nameÚbackend_pathr   c                 óª   •— || _         || _        |xs d| _        t        ‰| �  |xs d› | j                  rd| j                  › �z   «       y dz   «       y )NÚ zError while importing backendz

Traceback:
)r8   r9   r6   ÚsuperÚ__init__)r   r6   r7   r8   r9   Ú	__class__s        €r   r=   zBackendUnavailable.__init__.   sc   ø€ ð )ˆÔØ(ˆÔØ"š bˆŒÜ‰ÑØÒ9Ð9Ð:Ø6:·n²nÐ! $§.¡.Ð!1Ð2ñNõ	
àJLñNõ	
r   ©NNN)	r   r   r   r    r!   r
   r   r=   Ú__classcell__©r>   s   @r   r5   r5   +   s\   ø„ ÙOð
 "&Ø&*Ø04ñ
àð
ð ˜#‘ð
ð ˜s‘mð	
ð
 ˜x¨™}Ñ-ð
ð 
÷
ñ 
r   r5   c                   ó,   ‡ — e Zd ZdZdeddfˆ fd„Zˆ xZS )ÚHookMissingz>Will be raised on missing hooks (if a fallback can't be used).Ú	hook_namer   Nc                 ó2   •— t         ‰| �  |«       || _        y r   )r<   r=   rD   )r   rD   r>   s     €r   r=   zHookMissing.__init__B   s   ø€ Ü‰Ñ˜Ô#Ø"ˆ�r   )r   r   r   r    r!   r=   r@   rA   s   @r   rC   rC   ?   s   ø„ ÙHð# #ð #¨$÷ #ñ #r   rC   c                   ó    — e Zd ZdZdeddfd„Zy)ÚUnsupportedOperationzDMay be raised by build_sdist if the backend indicates that it can't.r6   r   Nc                 ó   — || _         y r   )r6   )r   r6   s     r   r=   zUnsupportedOperation.__init__J   s	   € Ø"ˆ�r   )r   r   r   r    r!   r=   r   r   r   rG   rG   G   s   „ ÙNð# #ð #¨$ô #r   rG   r   r   r   c                 ó˜   — t         j                  j                  «       }|r|j                  |«       t	        j
                  | ||d¬«       y)zpThe default method of calling the wrapper subprocess.

    This uses :func:`subprocess.run` under the hood.
    T)r   ÚenvÚcheckN)ÚosÚenvironÚcopyÚupdateÚ
subprocessÚrun©r   r   r   rJ   s       r   Údefault_subprocess_runnerrS   N   s5   € ô �*‰*�/‰/Ó
€CÙØ�
‰
�=Ô!ä‡N�N�3˜C S°Ö5r   c                 óÔ   — t         j                  j                  «       }|r|j                  |«       t	        j
                  | ||t        j                  t        j                  d¬«       y)zŠCall the subprocess while suppressing output.

    This uses :func:`subprocess.run` with `stdout=PIPE, stderr=STDOUT` under the hood.
    T)r   rJ   ÚstdoutÚstderrrK   N)rL   rM   rN   rO   rP   rQ   ÚPIPEÚSTDOUTrR   s       r   Úquiet_subprocess_runnerrY   ^   sM   € ô �*‰*�/‰/Ó
€CÙØ�
‰
�=Ô!ô ‡N�NØØØÜ�‰Ü× Ñ Øör   Úsource_treeÚ	requestedc                 óì  — t         j                  j                  |«      rt        d«      ‚t         j                  j	                  | «      }t         j                  j                  t         j                  j                  ||«      «      }t         j                  j                  |«      }t         j                  j                  |«      }t         j                  j                  ||g«      |k7  rt        d«      ‚|S )zèNormalise 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)	rL   r#   ÚisabsÚ
ValueErrorr   Únormpathr   ÚnormcaseÚ
commonpath)rZ   r[   Ú
abs_sourceÚabs_requestedÚnorm_sourceÚnorm_requesteds         r   Únorm_and_checkrf   v   s«   € ô 
‡w�w‡}�}�YÔÜÐ1Ó2Ð2ä—‘—‘ Ó-€JÜ—G‘G×$Ñ$¤R§W¡W§\¡\°*¸iÓ%HÓI€MÜ—'‘'×"Ñ" :Ó.€KÜ—W‘W×%Ñ% mÓ4€NÜ	‡w�w×Ñ˜;¨Ð7Ó8¸KÒGÜÐ;Ó<Ð<àÐr   c                   ó
  — e Zd ZdZ	 	 	 ddededeee      ded   dee   d	dfd
„Zeddd	e	d   fd„«       Z
d	ee   fd„Z	 ddeeeef      d	ee   fd„Z	 	 ddedeeeef      ded	efd„Z	 	 d dedeeeef      dee   d	efd„Z	 ddeeeef      d	ee   fd„Z	 	 ddedeeeef      ded	efd„Z	 	 d dedeeeef      dee   d	efd„Z	 ddeeeef      d	ee   fd„Z	 ddedeeeef      d	efd„Zdedeeef   d	efd„Zy)!ÚBuildBackendHookCallerzAA wrapper to call the build backend hooks for a source directory.NÚ
source_dirÚbuild_backendr9   Úrunnerr   Úpython_executabler   c                 óä   — |€t         }t        |«      | _        || _        |r#|D �cg c]  }t	        | j                  |«      ‘Œ }}|| _        || _        |st        j                  }|| _	        yc c}w )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)
rS   r   ri   rj   rf   r9   Ú_subprocess_runnerÚsysÚ
executablerl   )r   ri   rj   r9   rk   rl   Úps          r   r=   zBuildBackendHookCaller.__init__Ž   sn   € ð  ˆ>Ü.ˆFä! *Ó-ˆŒØ*ˆÔÙØHTÖUÀ1œN¨4¯?©?¸AÕ>ÐUˆLÐUØ(ˆÔØ"(ˆÔÙ Ü #§¡ÐØ!2ˆÕùò Vs   ¦A-c              #   ób   K  — | j                   }|| _         	 d–— || _         y# || _         w xY w­w)aÇ  A context manager for temporarily overriding the default
        :ref:`subprocess runner <Subprocess Runners>`.

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

        .. warning::

            This context manager temporarily mutates the hook caller instance and
            is not thread-safe. Callers that need to run hooks concurrently
            should create separate :class:`BuildBackendHookCaller` instances, or
            provide the subprocess runner when constructing the caller.

        .. code-block:: python

            hook_caller = BuildBackendHookCaller(...)
            with hook_caller.subprocess_runner(quiet_subprocess_runner):
                ...
        N)rn   )r   rk   Úprevs      r   Úsubprocess_runnerz(BuildBackendHookCaller.subprocess_runner«   s3   è ø€ ð( ×&Ñ&ˆØ"(ˆÔð	+Ûà&*ˆDÕ#ø dˆDÕ#üs   ‚/—# ›/£	,¬/c                 ó&   — | j                  di «      S )z>Return the list of optional features supported by the backend.Ú_supported_features©Ú
_call_hook)r   s    r   rv   z*BuildBackendHookCaller._supported_featuresÆ   s   € à�‰Ð4°bÓ9Ð9r   Úconfig_settingsc                 ó*   — | j                  dd|i«      S )am  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_wheelry   rw   ©r   ry   s     r   r{   z3BuildBackendHookCaller.get_requires_for_build_wheelÊ   s    € ð �‰Ø*Ð->ÀÐ,Pó
ð 	
r   Úmetadata_directoryÚ_allow_fallbackc                 ó@   — | j                  dt        |«      ||dœ«      S )aS  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}   ry   r~   ©rx   r   ©r   r}   ry   r~   s       r   r€   z7BuildBackendHookCaller.prepare_metadata_for_build_wheelÜ   s,   € ð0 �‰Ø.ä&-Ð.@Ó&AØ#2Ø#2ñó
ð 	
r   Úwheel_directoryc                 óZ   — |�t        |«      }| j                  dt        |«      ||dœ«      S )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„   ry   r}   ©r   rx   ©r   r„   ry   r}   s       r   r†   z"BuildBackendHookCaller.build_wheelý   s=   € ð* Ð)Ü!(Ð);Ó!<ÐØ�‰Øä#*¨?Ó#;Ø#2Ø&8ñó
ð 	
r   c                 ó*   — | j                  dd|i«      S )aw  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_editablery   rw   r|   s     r   r‹   z6BuildBackendHookCaller.get_requires_for_build_editable  s    € ð �‰Ø-Ð0AÀ?Ð/Só
ð 	
r   c                 ó@   — | j                  dt        |«      ||dœ«      S )aU  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�   z:BuildBackendHookCaller.prepare_metadata_for_build_editable/  s,   € ð. �‰Ø1ä&-Ð.@Ó&AØ#2Ø#2ñó
ð 	
r   c                 óZ   — |�t        |«      }| j                  dt        |«      ||dœ«      S )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�   z%BuildBackendHookCaller.build_editableO  s=   € ð, Ð)Ü!(Ð);Ó!<ÐØ�‰Øä#*¨?Ó#;Ø#2Ø&8ñó
ð 	
r   c                 ó*   — | j                  dd|i«      S )z…Get additional dependencies required for building an sdist.

        :returns: A list of :pep:`dependency specifiers <508>`.
        Úget_requires_for_build_sdistry   rw   r|   s     r   r‘   z3BuildBackendHookCaller.get_requires_for_build_sdistp  s    € ð �‰Ø*Ð->ÀÐ,Pó
ð 	
r   Úsdist_directoryc                 ó>   — | j                  dt        |«      |dœ«      S )z‰Build an sdist from this project.

        :returns:
            The name of the newly created sdist within ``sdist_directory``.
        Úbuild_sdist)r’   ry   r‚   )r   r’   ry   s      r   r”   z"BuildBackendHookCaller.build_sdist|  s(   € ð �‰Øä#*¨?Ó#;Ø#2ñó
ð 	
r   rD   r,   c           
      óÒ  — d| j                   i}| j                  r"t        j                  | j                  «      |d<   t	        j
                  «       5 }d|i}t        |t        |d«      d¬«       t        «       5 }| j                  }| j                  |t        t        |«      «      ||g| j                  |¬«       d d d «       t        t        |d«      «      }|j                  d	«      rt!        |j                  d
d«      «      ‚|j                  d«      rCt#        |j                  d
d«      |j                  dd«      | j                   | j                  ¬«      ‚|j                  d«      rt%        |j                  d«      xs |«      ‚|j                  dg «      D ](  }	t'        j(                  |	d   t*        |	d   |	d   ¬«       Œ* |d   cd d d «       S # 1 sw Y   �ŒxY w# 1 sw Y   y xY w)NÚ_PYPROJECT_HOOKS_BUILD_BACKENDÚ"_PYPROJECT_HOOKS_BACKEND_PATH_JSONr,   z
input.jsoné   )Úindent)r   r   zoutput.jsonÚunsupportedr6   r;   Ú
no_backendÚbackend_error)r7   r8   r9   Úhook_missingÚmissing_hook_nameÚwarningsr7   ÚfilenameÚlineno)r7   Úcategoryr    r¡   Ú
return_val)rj   r9   r*   ÚdumpsÚtempfileÚTemporaryDirectoryr.   Úpjoinr   rl   rn   r   r!   ri   r1   ÚgetrG   r5   rC   rŸ   Úwarn_explicitr3   )
r   rD   r,   r   ÚtdÚ
hook_inputÚscriptÚpythonÚdatar%   s
             r   rx   z!BuildBackendHookCaller._call_hookŽ  sË  € Ø9¸4×;MÑ;MÐNˆà×ÒÜBFÇ*Á*Ø×!Ñ!óCˆMÐ>Ñ?ô ×(Ñ(Ó*ð !	&¨bØ" FÐ+ˆJÜ�z¤5¨¨\Ó#:À1ÕEô &Ó'ð ¨6Ø×/Ñ/�Ø×'Ñ'ØœW¤S¨£[Ó1°9¸bÐAØŸ™Ø"/ð (ô ÷ô œU 2 }Ó5Ó6ˆDØ�x‰x˜Ô&Ü*¨4¯8©8°KÀÓ+DÓEÐEØ�x‰x˜Ô%Ü(Ø—H‘H˜[¨"Ó-Ø ŸH™H _°bÓ9Ø!%×!3Ñ!3Ø!%×!2Ñ!2ô	ð ð �x‰x˜Ô'Ü! $§(¡(Ð+>Ó"?Ò"LÀ9ÓMÐMà—X‘X˜j¨"Ó-ò �Ü×&Ñ&Ø˜i™LÜ0Ø˜z™]Ø˜X™;ö	ðð ˜Ñ%÷C!	&ñ !	&÷
ñ ú÷!	&ð !	&ús&   Á'GÁ8AGÂ9DGÇG	ÇGÇG&r?   r   )NTr   )r   r   r   r    r!   r
   r   r=   r   r   rt   rv   r	   r   r{   Úboolr€   r†   r‹   r�   r�   r‘   r”   rx   r   r   r   rh   rh   ‹   sŠ  „ ÙKð 15Ø/3Ø+/ñ3àð3ð ð3ð ˜x¨™}Ñ-ð	3ð
 Ð+Ñ,ð3ð $ C™=ð3ð 
ó3ð: ð+Ð(:ð +¸xÈ¹~ò +ó ð+ð4: X¨c¡]ó :ð 8<ñ
à! '¨#¨s¨(Ñ"3Ñ4ð
ð 
�#‰ó
ð* 8<Ø $ñ	
àð
ð " '¨#¨s¨(Ñ"3Ñ4ð
ð ð	
ð
 
ó
ðH 8<Ø,0ñ	
àð
ð " '¨#¨s¨(Ñ"3Ñ4ð
ð % S™Mð	
ð
 
ó
ðD 8<ñ
à! '¨#¨s¨(Ñ"3Ñ4ð
ð 
�#‰ó
ð* 8<Ø $ñ	
àð
ð " '¨#¨s¨(Ñ"3Ñ4ð
ð ð	
ð
 
ó
ðF 8<Ø,0ñ	
àð
ð " '¨#¨s¨(Ñ"3Ñ4ð
ð % S™Mð	
ð
 
ó
ðF 8<ñ

à! '¨#¨s¨(Ñ"3Ñ4ð

ð 
�#‰ó

ð 8<ñ
àð
ð " '¨#¨s¨(Ñ"3Ñ4ð
ð 
ó	
ð$)& Cð )&°¸¸c¸Ñ1Bð )&Àsô )&r   rh   r   )$r*   rL   ro   r¥   rP   Ú
contextlibr   Úos.pathr   r   r§   Útypingr   r   r   r	   r
   r   rŸ   Ú_in_processr   r   r   r!   r.   r1   ÚUserWarningr3   Ú	Exceptionr5   rC   rG   rS   rY   rf   rh   r   r   r   ú<module>r¶      s`  ðÛ Û 	Û 
Û Û Ý %Ý Ý !ß L× LÛ å -áÝô	˜8ô 	ð$�G˜C ˜HÑ%ð $¨Sð $¸tó $ð
�Cð ˜G C¨ HÑ-ó ô
M˜+ô Mô
˜ô 
ô(#�)ô #ô#˜9ô #ð Ø15ñ6Ø	�#‰ð6à	�#‰ð6ð ˜G C¨ HÑ-Ñ.ð6ð 
ó	6ð$ Ø15ñØ	�#‰ðà	�#‰ðð ˜G C¨ HÑ-Ñ.ðð 
ó	ð0 ð °ð ¸ó ÷*l&ò l&r   