Ë äpdÅûÙ×ãóö—ddlZddlZddlZddlZddlmZddlmZddlmZ ddl m Z m Z m Z ddlmZd„Zd „ZGd „d e«ZGd „d e«ZGd„de«ZGd„de«Zdd„Zdd„Zd„ZGd„d«Zy)éN)Úcontextmanager)Úabspath)Újoin)ÚSTDOUTÚ check_callÚ check_outputé)Ú_in_proc_script_pathc óx—t|dd¬«5}tj||fi|¤Žddd«y#1swYyxYw)NÚwúutf-8©Úencoding)ÚopenÚjsonÚdump)ÚobjÚpathÚkwargsÚfs ú:/usr/lib/python3.12/site-packages/pyproject_hooks/_impl.pyÚ write_jsonr s/€Ü ˆd�C 'Õ *¨aÜ � ‰ �#�qÑ#˜FÒ#÷ +× *Ñ *ús�0°9cór—t|d¬«5}tj|«cddd«S#1swYyxYw)Nr r)rrÚload)rrs rÚ read_jsonrs%€Ü ˆd˜WÕ %¨Ü�y‰y˜‹|÷ &× %Ò %úsŽ-­6có—eZdZdZd„Zy)ÚBackendUnavailablezEWill be raised if the backend cannot be imported in the hook process.có—||_y©N©Ú traceback©Úselfr!s rÚ__init__zBackendUnavailable.__init__ó €Ø"ˆ�óN©Ú__name__Ú __module__Ú __qualname__Ú__doc__r$©r&rrrs „ÙOó#r&rcó"‡—eZdZdZˆfd„ZˆxZS)ÚBackendInvalidz)Will be raised if the backend is invalid.có@•—t‰|�|«||_||_yr)Úsuperr$Ú backend_nameÚ backend_path)r#r1r2ÚmessageÚ __class__s €rr$zBackendInvalid.__init__s ø€Ü ‰Ñ˜Ô!Ø(ˆÔØ(ˆÕr&©r(r)r*r+r$Ú __classcell__©r4s@rr.r.sø„Ù3÷)ð)r&r.có"‡—eZdZdZˆfd„ZˆxZS)Ú HookMissingz>Will be raised on missing hooks (if a fallback can't be used).có2•—t‰|�|«||_yr)r0r$Ú hook_name)r#r;r4s €rr$zHookMissing.__init__'sø€Ü ‰Ñ˜Ô#Ø"ˆ�r&r5r7s@rr9r9%sø„ÙH÷#ð#r&r9có—eZdZdZd„Zy)ÚUnsupportedOperationzDMay be raised by build_sdist if the backend indicates that it can't.có—||_yrr r"s rr$zUnsupportedOperation.__init__.r%r&Nr'r,r&rr=r=,s „ÙNó#r&r=có‚—tjj«}|r|j|«t |||¬«y)zwThe default method of calling the wrapper subprocess. This uses :func:`subprocess.check_call` under the hood. )ÚcwdÚenvN)ÚosÚenvironÚcopyÚupdater©Úcmdr@Ú extra_environrAs rÚdefault_subprocess_runnerrI2s/€ô �*‰*�/‰/Ó €CÙØ � ‰ �=Ô!äˆs˜ Ö%r&cóŒ—tjj«}|r|j|«t |||t ¬«y)zqCall the subprocess while suppressing output. This uses :func:`subprocess.check_output` under the hood. )r@rAÚstderrN)rBrCrDrErrrFs rÚquiet_subprocess_runnerrL>s1€ô �*‰*�/‰/Ó €CÙØ � ‰ �=Ô!ä�˜# 3¬vÖ6r&cóì—tjj|«r td«‚tjj |«}tjj tjj ||««}tjj|«}tjj|«}tjj||g«|k7r td«‚|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. zpaths must be relativez paths must be inside source tree) rBrÚisabsÚ ValueErrorrÚnormpathrÚnormcaseÚ commonprefix)Ú source_treeÚ requestedÚ abs_sourceÚ abs_requestedÚ norm_sourceÚnorm_requesteds rÚnorm_and_checkrYJs­€ô ‡w�w‡}�}�YÔÜÐ1Ó2Ð2ä—‘—‘ Ó-€JÜ—G‘G×$Ñ$¤R§W¡W§\¡\°*¸iÓ%HÓI€Mô—'‘'×"Ñ" :Ó.€KÜ—W‘W×%Ñ% mÓ4€NÜ ‡w�w×ј[¨.Ð9Ó:¸kÒIÜÐ;Ó<Ð<à Ðr&cóŠ—eZdZdZ dd„Zed„«Zd„Zdd„Z dd„Z dd„Z dd „Z dd „Z dd „Z dd „Zdd „Zd„Zy)ÚBuildBackendHookCallerzFA wrapper to call the build backend hooks for a source directory. Ncóä—|€t}t|«|_||_|r#|D�cgc]}t |j|«‘Œ}}||_||_|stj}||_ ycc}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 ` to use :param python_executable: The Python executable used to invoke the build backend N) rIrÚ source_dirÚ build_backendrYr2Ú_subprocess_runnerÚsysÚ executableÚpython_executable)r#r]r^r2ÚrunnerrbÚps rr$zBuildBackendHookCaller.__init__fsx€ð ˆ>Ü.ˆFä! *Ó-ˆŒØ*ˆÔÙ á`. .. code-block:: python hook_caller = BuildBackendHookCaller(...) with hook_caller.subprocess_runner(quiet_subprocess_runner): ... N)r_)r#rcÚprevs rÚsubprocess_runnerz(BuildBackendHookCaller.subprocess_runner…s3èø€ð×&Ñ&ˆØ"(ˆÔð +Û à&*ˆDÕ #ø dˆDÕ #üs‚/—#›/£ ,¬/có&—|jdi«S)z>Return the list of optional features supported by the backend.Ú_supported_features©Ú _call_hook)r#s rriz*BuildBackendHookCaller._supported_features—s€à�‰Ð4°bÓ9Ð9r&có*—|jdd|i«S)a6Get additional dependencies required for building a wheel. :returns: A list of :pep:`dependency specifiers <508>`. :rtype: list[str] .. admonition:: Fallback If the build backend does not defined a hook with this name, an empty list will be returned. Úget_requires_for_build_wheelÚconfig_settingsrj©r#rns rrmz3BuildBackendHookCaller.get_requires_for_build_wheel›s#€ð�‰Ð=Ø ˜ð@ ó ð r&có@—|jdt|«||dœ«S)aPrepare a ``*.dist-info`` folder with metadata for this project. :returns: Name of the newly created subfolder within ``metadata_directory``, containing the metadata. :rtype: str .. 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©Úmetadata_directoryrnÚ_allow_fallback©rkr©r#rsrnrts rrqz7BuildBackendHookCaller.prepare_metadata_for_build_wheelªs-€ð �‰ÐAÜ")Ð*<Ó"=Ø.Ø.ñD ó ð r&cóZ—|� t|«}|jdt|«||dœ«S)aïBuild a wheel from this project. :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©Úwheel_directoryrnrs©rrk©r#rzrnrss rrxz"BuildBackendHookCaller.build_wheelÀs<€ð Ð )Ü!(Ð);Ó!<Ð Ø�‰˜}Ü& Ó7Ø.Ø"4ñ/ ó ð r&có*—|jdd|i«S)a@Get additional dependencies required for building an editable wheel. :returns: A list of :pep:`dependency specifiers <508>`. :rtype: list[str] .. admonition:: Fallback If the build backend does not defined a hook with this name, an empty list will be returned. Úget_requires_for_build_editablernrjros rr~z6BuildBackendHookCaller.get_requires_for_build_editable×s#€ð�‰Ð@Ø ˜ðC ó ð r&có@—|jdt|«||dœ«S)aPrepare a ``*.dist-info`` folder with metadata for this project. :returns: Name of the newly created subfolder within ``metadata_directory``, containing the metadata. :rtype: str .. 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_editablerrrurvs rr€z:BuildBackendHookCaller.prepare_metadata_for_build_editableæs-€ð �‰ÐDÜ")Ð*<Ó"=Ø.Ø.ñG ó ð r&cóZ—|� t|«}|jdt|«||dœ«S)a Build an editable wheel from this project. :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_editableryr{r|s rr‚z%BuildBackendHookCaller.build_editableüs=€ð Ð )Ü!(Ð);Ó!<Ð Ø�‰Ð/Ü& Ó7Ø.Ø"4ñ2 ó ð r&có*—|jdd|i«S)zŸGet additional dependencies required for building an sdist. :returns: A list of :pep:`dependency specifiers <508>`. :rtype: list[str] Úget_requires_for_build_sdistrnrjros rr„z3BuildBackendHookCaller.get_requires_for_build_sdists#€ð �‰Ð=Ø ˜ð@ ó ð r&có>—|jdt|«|dœ«S)z‰Build an sdist from this project. :returns: The name of the newly created sdist within ``wheel_directory``. Ú build_sdist)Úsdist_directoryrnru)r#r‡rns rr†z"BuildBackendHookCaller.build_sdists'€ð �‰˜}Ü& Ó7Ø.ñ/ ó ð r&c ó¤—d|ji}|jr.tjj |j«}||d<t j «5}d|i}t|t|d«d¬«t«5}|j}|j|tt|««||g|j|¬«ddd«tt|d««} | j!d «rt#| j!d d ««‚| j!d «rt%| j!d d ««‚| j!d «r2t'|j|j| j!dd «¬«‚| j!d«rt)| j!d«xs|«‚| dcddd«S#1swYŒöxYw#1swYyxYw)NÚPEP517_BUILD_BACKENDÚPEP517_BACKEND_PATHrz input.jsoné)Úindent)r@rHz output.jsonÚ unsupportedr!ÚÚ no_backendÚbackend_invalidÚ backend_error)r1r2r3Ú hook_missingÚmissing_hook_nameÚ return_val)r^r2rBÚpathseprÚtempfileÚTemporaryDirectoryrÚpjoinr rbr_rÚstrr]rÚgetr=rr.r9) r#r;rrHr2ÚtdÚ hook_inputÚscriptÚpythonÚdatas rrkz!BuildBackendHookCaller._call_hook)s�€Ø/°×1CÑ1CÐDˆ à × Ò ÜŸ:™:Ÿ?™?¨4×+<Ñ+<Ó=ˆLØ3?ˆMÐ/Ñ 0ä × (Ñ (Ô *¨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˜ Ô%Ü(¨¯©°+¸rÓ)BÓCÐCØ�x‰xÐ)Ô*Ü$Ø!%×!3Ñ!3Ø!%×!2Ñ!2Ø ŸH™H _°bÓ9ôðð �x‰x˜Ô'Ü! $§(¡(Ð+>Ó"?Ò"LÀ9ÓMÐMؘ Ñ%÷5+Ñ *÷ (Ð'ú÷ +Ð *ús&Á'GÂAF:ÃC+GÆ:G Æ?GÇG)NNNr)NT©NN)r(r)r*r+r$rrgrirmrqrxr~r€r‚r„r†rkr,r&rr[r[bs}„ñðØØ"ó 3ð>ñ+óð+ò":ó  ð 7;Ø ó ð.48Ø#ó ó.  ð 7;Ø ó ð.48Ø#ó ó0 ó  ó!&r&r[r )rrBr`r–Ú contextlibrÚos.pathrrr˜Ú subprocessrrrÚ _in_processr rrÚ Exceptionrr.r9r=rIrLrYr[r,r&rÚr¦sxðÛ Û Û ÛÝ%ÝÝ!ß7Ñ7å-ò$ò ô #˜ô#ô )�Yô)ô#�)ô#ô#˜9ô#ó &ó 7ò÷0h&òh&r&