kghX: ddlZddlZddlZddlZddlmZddlmZddlmZ ddl m Z m Z m Z ddlmZmZmZmZmZmZddlmZerdd lmZGd d eZd eeefd eddfdZd edeeeffdZGddeZGddeZGddeZ d!deedeedeeeefddfdZ d!deedeedeeeefddfdZ!dededefdZ"Gdd Z#dS)"N)contextmanager)abspath)join)STDOUT check_call check_output) TYPE_CHECKINGAnyIteratorMappingOptionalSequence)_in_proc_script_path)Protocolc deZdZdZ ddeedeedeeeefddfdZdS) SubprocessRunnerz%A protocol for the subprocess runner.Ncmdcwd extra_environreturncdSN)selfrrrs /builddir/build/BUILD/imunify360-venv-2.6.0/opt/imunify360/venv/lib/python3.11/site-packages/pip/_vendor/pyproject_hooks/_impl.py__call__zSubprocessRunner.__call__s CNN) __name__ __module__ __qualname____doc__rstrr r rrrrrrsw33 "&9=   # # $GCH$56          rrobjpathrc t|dd5}tj||fi|ddddS#1swxYwYdS)Nwutf-8encoding)openjsondump)r%r&kwargsfs r write_jsonr1s dC' * * *$a #q##F###$$$$$$$$$$$$$$$$$$s 488ct|d5}tj|cdddS#1swxYwYdS)Nr)r*)r,r-load)r&r0s r read_jsonr4!s dW % % %y||s 377c peZdZdZ d dedeedeedeeeddf fd ZxZS) BackendUnavailablezEWill be raised if the backend cannot be imported in the hook process.N tracebackmessage backend_name backend_pathrcx||_||_||_t|pddS)NzError while importing backend)r9r:r7super__init__)rr7r8r9r: __class__s rr=zBackendUnavailable.__init__)s@)(" C$CDDDDDrNNN) r r!r"r#r$r rr= __classcell__r>s@rr6r6&sOO "&&*04 E E E# Esm E x}- E  E E E E E E E E E Err6c,eZdZdZdeddffd ZxZS) HookMissingz>Will be raised on missing hooks (if a fallback can't be used). hook_namerNcXt|||_dSr)r<r=rD)rrDr>s rr=zHookMissing.__init__:s& ###"r)r r!r"r#r$r=r@rAs@rrCrC7sQHH###$##########rrCc"eZdZdZdeddfdZdS)UnsupportedOperationzDMay be raised by build_sdist if the backend indicates that it can't.r7rNc||_dSr)r7)rr7s rr=zUnsupportedOperation.__init__Bs "r)r r!r"r#r$r=rrrrGrG?s<NN###$######rrGrrrctj}|r||t |||dS)zwThe default method of calling the wrapper subprocess. This uses :func:`subprocess.check_call` under the hood. )renvN)osenvironcopyupdaterrrrrJs rdefault_subprocess_runnerrPFsJ *//  C" =!!!s%%%%%%rctj}|r||t |||t dS)zqCall the subprocess while suppressing output. This uses :func:`subprocess.check_output` under the hood. )rrJstderrN)rKrLrMrNrrrOs rquiet_subprocess_runnerrSVsL *//  C" =!!!#3v666666r source_tree requestedctj|rtdtj|}tjtj||}tj|}tj|}tj||g|krtd|S)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. zpaths must be relativez paths must be inside source tree) rKr&isabs ValueErrorrnormpathrnormcase commonprefix)rTrU abs_source abs_requested norm_sourcenorm_requesteds rnorm_and_checkr`fs w}}Y31222--JG$$RW\\*i%H%HIIM'"":..KW%%m44N w[.9::kII;<<< rc eZdZdZ ddededeeededdeed df d Zeddd e dfd Z d eefd Z dd ee ee fd eefdZ d ded ee ee fded efdZ d!ded ee ee fdeed efdZ dd ee ee fd eefdZ d ded ee ee fded eefdZ d!ded ee ee fdeed efdZ dd ee ee fd eefdZ dded ee ee fd efdZdede ee fd e fdZdS)"BuildBackendHookCallerzAA wrapper to call the build backend hooks for a source directory.N source_dir build_backendr:runnerrpython_executablerc|t}t|_|_|rfd|D}|_|_|s t j}|_dS)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 Nc:g|]}tj|Sr)r`rc).0prs r z3BuildBackendHookCaller.__init__..s%UUU1N4?A>>UUUr) rPrrcrdr:_subprocess_runnersys executablerf)rrcrdr:rerfs` rr=zBuildBackendHookCaller.__init__sv >.F!*--*  VUUUU UUUL("(  / # !2rc#VK|j}||_ dV||_dS#||_wxYw)ayA context manager for temporarily overriding the default :ref:`subprocess runner `. :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)rl)rreprevs rsubprocess_runnerz(BuildBackendHookCaller.subprocess_runnersH&"( + EEE&*D # # #dD # * * * *s (c.|diS)z>Return the list of optional features supported by the backend._supported_features _call_hook)rs rrsz*BuildBackendHookCaller._supported_featuress4b999rconfig_settingsc2|dd|iS)amGet 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_wheelrvrtrrvs rrxz3BuildBackendHookCaller.get_requires_for_build_wheels% *->,P   rTmetadata_directory_allow_fallbackcP|dt|||dS)aSPrepare 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_wheelrzrvr{rurrrzrvr{s rr}z7BuildBackendHookCaller.prepare_metadata_for_build_wheels90 .&-.@&A&A#2#2     rwheel_directorycr|t|}|dt|||dS)aBuild 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. N build_wheelrrvrzrrurrrvrzs rrz"BuildBackendHookCaller.build_wheelsM*  )!();!`. .. admonition:: Fallback If the build backend does not defined a hook with this name, an empty list will be returned. get_requires_for_build_editablervrtrys rrz6BuildBackendHookCaller.get_requires_for_build_editable s% -0A?/S   rcP|dt|||dS)aUPrepare 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~rrs rrz:BuildBackendHookCaller.prepare_metadata_for_build_editables9. 1&-.@&A&A#2#2     rcr|t|}|dt|||dS)aBuild 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. Nbuild_editablerrrs rrz%BuildBackendHookCaller.build_editable;sM,  )!();!`. get_requires_for_build_sdistrvrtrys rrz3BuildBackendHookCaller.get_requires_for_build_sdist\s% *->,P   rsdist_directorycN|dt||dS)zBuild an sdist from this project. :returns: The name of the newly created sdist within ``wheel_directory``. build_sdist)rrvr)rrrvs rrz"BuildBackendHookCaller.build_sdisths5 #*?#;#;#2     rrDr/c d|ji}|jr)tj|j}||d<t j5}d|i}t|t|ddt5}|j }| |tt|||g|j|dddn #1swxYwYtt|d} | d r#t#| d d | d rEt%| d d | d d |j|j| dr$t'| dp|| dcdddS#1swxYwYdS)N_PYPROJECT_HOOKS_BUILD_BACKEND_PYPROJECT_HOOKS_BACKEND_PATHr/z input.json)indent)rrz output.json unsupportedr7 no_backend backend_error)r8r9r: hook_missingmissing_hook_name return_val)rdr:rKpathseprtempfileTemporaryDirectoryr1pjoinrrfrlrr$rcr4getrGr6rC) rrDr/rr:td hook_inputscriptpythondatas rruz!BuildBackendHookCaller._call_hookzs^94;MN   J:??4+<==L=IM9 :  ( * * &b"F+J z5\#:#:1 E E E E&'' 6/''WS[[119bA"/(               U2}5566Dxx && F*488K+D+DEEExx %% (HH["-- HH_b99!%!3!%!2  xx'' N!$((+>"?"?"L9MMM %3 & & & & & & & & & & & & & & & & & &s8 3GAC GC GC C2GGGr?r)NTr)r r!r"r#r$r rr=rr rqrsr r rxboolr}rrrrrrrurrrrbrb~sKK 15/3+/ 3333x}- 3 +, 3 $C= 3 3333:+(:+x~+++^+&:Xc]:::: 8<  !'#s("34  #    *8< $    "'#s("34       H8<,0    "'#s("34 %SM      D8<  !'#s("34  #    *8< $    "'#s("34   #     F8<,0    "'#s("34 %SM      F8<   !'#s("34   #     8<   "'#s("34      $ &C &c1B &s & & & & & &rrbr)$r-rKrmr contextlibros.pathrrr subprocessrrrtypingr r r r r r _in_processrrrr$r1r4 Exceptionr6rCrGrPrSr`rbrrrrs %%%%%%!!!!!!7777777777LLLLLLLLLLLLLLLL------      8   $GCH%$S$t$$$$ CGCH- EEEEEEEE"#####)########9###15 & & # & # &GCH-. & & & & &$15 7 7 # 7 # 7GCH-. 7 7 7 7 7 0\&\&\&\&\&\&\&\&\&\&r