HEX
Server: Apache/2.4.52 (Ubuntu)
System: Linux spn-python 5.15.0-89-generic #99-Ubuntu SMP Mon Oct 30 20:42:41 UTC 2023 x86_64
User: arjun (1000)
PHP: 8.1.2-1ubuntu2.20
Disabled: NONE
Upload Files
File: //lib/python3/dist-packages/pip/_vendor/pep517/__pycache__/envbuild.cpython-310.pyc
o

@%Ne��@s�dZddlZddlZddlZddlZddlmZddlZddlm	Z	ddl
mZddlm
Z
ddlmZmZe�e�Zd	d
�ZGdd�de�Zdd
d�Zddd�ZdS)zIBuild wheels/sdists by installing build deps to a temporary environment.
�N)�
check_call)�	get_paths)�mkdtemp�)�	toml_load)�Pep517HookCaller�
LoggerWrappercCs^t�tj�|d�d��}t|�}Wd�n1swY|d}|d|d|�d�fS)Nzpyproject.toml�rbzbuild-system�requiresz
build-backendzbackend-path)�io�open�os�path�joinr�get)�
source_dir�f�pyproject_data�buildsys�r�=/usr/lib/python3/dist-packages/pip/_vendor/pep517/envbuild.py�_load_pyprojects�
��rc@s6eZdZdZdZddd�Zdd�Zdd	�Zd
d�ZdS)
�BuildEnvironmentz�Context manager to install build deps in a simple temporary environment

    Based on code I wrote for pip, which is MIT licensed.
    NTcCs
||_dS�N)�_cleanup)�self�cleanuprrr�__init__=s
zBuildEnvironment.__init__cCs�tdd�|_t�d|j�tj�dd�|_tj�dd�|_tj	dkr$dnd}t
||j|jd�d	�}|d
}|jrD|tj|jtjd<n|tjtjtjd<|d|dkr\|d}n|dtj|d}|jrw|tj|jtjd<|S|tjd<|S)
Nzpep517-build-env-)�prefixzTemporary build environment: %s�PATH�
PYTHONPATH�nt�posix_prefix)�base�platbase)�vars�scripts�purelib�platlib)
rr�log�infor
�environr�	save_path�save_pythonpath�namer�pathsep�defpath)r�install_scheme�install_dirsr&�lib_dirsrrr�	__enter__@s2
�
�
�
�zBuildEnvironment.__enter__cCsT|sdSt�d|�tjddddd|jgt|�}t|tttj	�tttj
�d�dS)	zAInstall dependencies into this env by calling pip in a subprocessNzCalling pip to install %sz-m�pip�installz--ignore-installedz--prefix)�stdout�stderr)r)r*�sys�
executabler�listrr�logging�INFO�ERROR)r�reqs�cmdrrr�pip_install`s��


�zBuildEnvironment.pip_installcCs�|jo|jduotj�|j�}|rt�|j�|jdur$tj�dd�n|jtjd<|j	dur8tj�dd�dS|j	tjd<dS)Nrr )
rrr
�isdir�shutil�rmtreer,r+�popr-)r�exc_type�exc_val�exc_tb�
needs_cleanuprrr�__exit__ns��

zBuildEnvironment.__exit__)T)	�__name__�
__module__�__qualname__�__doc__rrr4rArJrrrrr!s
 rc	C�z|duri}t|�\}}}t|||�}t��}|�|�|�|�}|�|�|�||�Wd�S1s6wYdS)amBuild a wheel from a source directory using PEP 517 hooks.

    :param str source_dir: Source directory containing pyproject.toml
    :param str wheel_dir: Target directory to create wheel in
    :param dict config_settings: Options to pass to build backend

    This is a blocking function which will run pip in a subprocess to install
    build requirements.
    N)rrrrA�get_requires_for_build_wheel�build_wheel)	r�	wheel_dir�config_settingsr
�backend�backend_path�hooks�envr?rrrrQ��




$�rQc	CrO)amBuild an sdist from a source directory using PEP 517 hooks.

    :param str source_dir: Source directory containing pyproject.toml
    :param str sdist_dir: Target directory to place sdist in
    :param dict config_settings: Options to pass to build backend

    This is a blocking function which will run pip in a subprocess to install
    build requirements.
    N)rrrrA�get_requires_for_build_sdist�build_sdist)	r�	sdist_dirrSr
rTrUrVrWr?rrrrZ�rXrZr)rNrr
r<rC�
subprocessrr9�	sysconfigr�tempfiler�compatr�wrappersrr�	getLoggerrKr)r�objectrrQrZrrrr�<module>s 

a