HEX
Server: Apache
System: Linux zacp120.webway.host 4.18.0-553.50.1.lve.el8.x86_64 #1 SMP Thu Apr 17 19:10:24 UTC 2025 x86_64
User: govancoz (1003)
PHP: 8.3.26
Disabled: exec,system,passthru,shell_exec,proc_close,proc_open,dl,popen,show_source,posix_kill,posix_mkfifo,posix_getpwuid,posix_setpgid,posix_setsid,posix_setuid,posix_setgid,posix_seteuid,posix_setegid,posix_uname
Upload Files
File: //usr/lib/python3.9/site-packages/pip/_vendor/pep517/__pycache__/wrappers.cpython-39.pyc
a

?�f*�@s2ddlZddlmZddlZddlmZmZmZddl	Z	ddl
mZmZm
Z
ddlZddlmZddlmZzddlmZdd	�ZWney�ed
d	��ZYn0edd��ZGd
d�de�ZGdd�de�ZGdd�de�ZGdd�de�Zddd�Zd dd�Zdd�ZGdd�de �Z!Gdd�dej"�Z#dS)!�N)�contextmanager)�dirname�abspath�join)�
check_call�check_output�STDOUT)�mkdtemp�)�compatcCst�td�S�Nz_in_process.py)�	resources�path�__package__�rr�?/usr/lib/python3.9/site-packages/pip/_vendor/pep517/wrappers.py�_in_proc_script_pathsrccstttt��d�VdSr)�pjoinrr�__file__rrrrrsc	cs,t�}z|VWt�|�nt�|�0dS�N)r	�shutilZrmtree)�tdrrr�tempdirsrc@seZdZdZdd�ZdS)�BackendUnavailablezEWill be raised if the backend cannot be imported in the hook process.cCs
||_dSr��	traceback��selfrrrr�__init__#szBackendUnavailable.__init__N��__name__�
__module__�__qualname__�__doc__rrrrrr!src@seZdZdZdd�ZdS)�BackendInvalidz)Will be raised if the backend is invalid.cCs||_||_||_dSr��backend_name�backend_path�message)rr&r'r(rrrr)szBackendInvalid.__init__Nrrrrrr$'sr$cs eZdZdZ�fdd�Z�ZS)�HookMissingz Will be raised on missing hooks.cstt|��|�||_dSr)�superr)r�	hook_name)rr+��	__class__rrr1szHookMissing.__init__)r r!r"r#r�
__classcell__rrr,rr)/sr)c@seZdZdZdd�ZdS)�UnsupportedOperationzDMay be raised by build_sdist if the backend indicates that it can't.cCs
||_dSrrrrrrr8szUnsupportedOperation.__init__Nrrrrrr/6sr/cCs*tj��}|r|�|�t|||d�dS)z5The default method of calling the wrapper subprocess.)�cwd�envN)�os�environ�copy�updater��cmdr0�
extra_environr1rrr�default_subprocess_runner<s

r9cCs,tj��}|r|�|�t|||td�dS)zDA method of calling the wrapper subprocess while suppressing output.)r0r1�stderrN)r2r3r4r5rrr6rrr�quiet_subprocess_runnerEs

r;cCsntj�|�rtd��tj�|�}tj�tj�||��}tj�|�}tj�|�}tj�||g�|krjtd��|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)	r2r�isabs�
ValueErrorr�normpathr�normcase�commonprefix)Zsource_treeZ	requestedZ
abs_sourceZ
abs_requestedZnorm_sourceZnorm_requestedrrr�norm_and_checkNsrAc@s`eZdZdZddd�Zedd��Zddd�Zdd
d�Zddd
�Z	ddd�Z
ddd�Zdd�ZdS)�Pep517HookCalleraeA wrapper around a source directory to be built with a PEP 517 backend.

    source_dir : The path to the source directory, containing pyproject.toml.
    build_backend : The build backend spec, as per PEP 517, from
        pyproject.toml.
    backend_path : The backend path, as per PEP 517, from pyproject.toml.
    runner : A callable that invokes the wrapper subprocess.

    The 'runner', if provided, must expect the following:
        cmd : a list of strings representing the command and arguments to
            execute, as would be passed to e.g. 'subprocess.check_call'.
        cwd : a string representing the working directory that must be
            used for the subprocess. Corresponds to the provided source_dir.
        extra_environ : a dict mapping environment variable names to values
            which must be set for the subprocess execution.
    NcsB|durt}t|��_|�_|r2�fdd�|D�}|�_|�_dS)Ncsg|]}t�j|��qSr)rA�
source_dir)�.0�p�rrr�
<listcomp>�sz-Pep517HookCaller.__init__.<locals>.<listcomp>)r9rrC�
build_backendr'�_subprocess_runner)rrCrHr'�runnerrrFrrws

�zPep517HookCaller.__init__ccs*|j}||_zdVW||_n||_0dS)z\A context manager for temporarily overriding the default subprocess
        runner.
        N)rI)rrJ�prevrrr�subprocess_runner�s
z"Pep517HookCaller.subprocess_runnercCs|�dd|i�S)aGIdentify packages required for building a wheel

        Returns a list of dependency specifications, e.g.:
            ["wheel >= 0.25", "setuptools"]

        This does not include requirements specified in pyproject.toml.
        It returns the result of calling the equivalently named hook in a
        subprocess.
        �get_requires_for_build_wheel�config_settings��
_call_hook�rrNrrrrM�s
�z-Pep517HookCaller.get_requires_for_build_wheelTcCs|�dt|�||d��S)aqPrepare a *.dist-info folder with metadata for this project.

        Returns the name of the newly created folder.

        If the build backend defines a hook with this name, it will be called
        in a subprocess. If not, the backend will be asked to build a wheel,
        and the dist-info extracted from that (unless _allow_fallback is
        False).
        � prepare_metadata_for_build_wheel)�metadata_directoryrN�_allow_fallback�rPr)rrSrNrTrrrrR�s
�z1Pep517HookCaller.prepare_metadata_for_build_wheelcCs(|durt|�}|�dt|�||d��S)avBuild a wheel from this project.

        Returns the name of the newly created file.

        In general, this will call the 'build_wheel' hook in the backend.
        However, if that was previously called by
        'prepare_metadata_for_build_wheel', and the same metadata_directory is
        used, the previously built wheel will be copied to wheel_directory.
        N�build_wheel)�wheel_directoryrNrS)rrP)rrWrNrSrrrrV�s�zPep517HookCaller.build_wheelcCs|�dd|i�S)a<Identify packages required for building a wheel

        Returns a list of dependency specifications, e.g.:
            ["setuptools >= 26"]

        This does not include requirements specified in pyproject.toml.
        It returns the result of calling the equivalently named hook in a
        subprocess.
        �get_requires_for_build_sdistrNrOrQrrrrX�s
�z-Pep517HookCaller.get_requires_for_build_sdistcCs|�dt|�|d��S)z�Build an sdist from this project.

        Returns the name of the newly created file.

        This calls the 'build_sdist' backend hook in a subprocess.
        �build_sdist)�sdist_directoryrNrU)rrZrNrrrrY�s�zPep517HookCaller.build_sdistc
	Cs|tjddkr|j�d�}n|j}d|i}|jrbtj�|j�}tjddkrZ|�t���}||d<t	����}d|i}t
j|t|d�dd�t
��0}|jtjt|�||g|j|d	�Wd�n1s�0Yt
�t|d
��}	|	�d�r�t|	�dd
���|	�d��rt|	�dd
���|	�d��r<t|j|j|	�dd
�d��|	�d��rPt|��|	dWd�S1�sn0YdS)Nr��ASCIIZPEP517_BUILD_BACKENDZPEP517_BACKEND_PATH�kwargsz
input.json)�indent)r0r8zoutput.jsonZunsupportedr�Z
no_backendZbackend_invalidZ
backend_errorr%Zhook_missingZ
return_val)�sys�version_inforH�encoder'r2�pathsepr�getfilesystemencodingrrZ
write_jsonrrrI�
executable�strrCZ	read_json�getr/rr$r))
rr+r]rHr8r'rZ
hook_inputZscript�datarrrrP�sD
��$

�zPep517HookCaller._call_hook)NN)N)NT)NN)N)N)
r r!r"r#rrrLrMrRrVrXrYrPrrrrrBfs �


�
�


rBc@s<eZdZdZdd�Zdd�Zedd��Zdd	�Zd
d�Z	dS)
�
LoggerWrapperzd
    Read messages from a pipe and redirect them
    to a logger (see python's logging module).
    cCsHtj�|�d|_||_||_t��\|_|_	t�
|j�|_|��dS)NT)
�	threading�ThreadrZdaemon�logger�levelr2�pipeZfd_read�fd_write�fdopen�reader�start)rrlrmrrrrszLoggerWrapper.__init__cCs|jSr)rorFrrr�fileno(szLoggerWrapper.filenocCs|�tj�r|dd�S|S)N���)�endswithr2�linesep)�msgrrr�remove_newline+szLoggerWrapper.remove_newlinecCs |jD]}|�|�|��qdSr)rq�_writerx)r�linerrr�run/s
zLoggerWrapper.runcCs|j�|j|�dSr)rl�logrm)rr(rrrry3szLoggerWrapper._writeN)
r r!r"r#rrs�staticmethodrxr{ryrrrrris

ri)NN)NN)$rj�
contextlibrr2Zos.pathrrrrr�
subprocessrrrr`Ztempfiler	r_rZimportlib.resourcesr
r�ImportErrorr�	Exceptionrr$r)r/r9r;rA�objectrBrkrirrrr�<module>s4

	
	0