<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0-alpha1/dist/css/bootstrap.min.css" rel="stylesheet"
        integrity="sha384-GLhlTQ8iRABdZLl6O3oVMWSktQOp6b7In1Zl3/Jr59b6EGGoI1aFkw7cmDA6j6gD" crossorigin="anonymous">
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.3.0/css/all.min.css"
        integrity="sha512-SzlrxWUlpfuzQ+pcUCosxcglQRNAq/DZjVsC0lE40xsADsfeQoEypE+enwcOiGjk/bSuGGKHEyjSoQ1zVisanQ=="
        crossorigin="anonymous" referrerpolicy="no-referrer" />
</head>
</html>
a
    Re                     @   s  d Z 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mZ ddlmZmZ eeZdd	 Zd
d Zdd Zdd Zd"ddZe Zejddd ejddddd ejddddd ejdddd dd  Zed!kr ee  dS )#z%Build a project using PEP 517 hooks.
    N   )BuildEnvironment)Pep517HookCaller)tempdirmkdir_p)FileNotFoundError	toml_loadc                 C   s4   ddh}|t | ks0dj|t |  d}t|dS )z7
    Ensure build system has the requisite fields.
    requiresbuild-backendz"Missing required fields: {missing})missingN)setformat
ValueError)systemrequiredmessage r   /builddir/build/BUILDROOT/alt-python39-pip-21.3.1-2.el8.x86_64/opt/alt/python39/lib/python3.9/site-packages/pip/_vendor/pep517/build.pyvalidate_system   s    
r   c                 C   sJ   t j| d}t|d}t|}W d   n1 s80    Y  |d S )zC
    Load the build system from a source dir (pyproject.toml).
    zpyproject.tomlrbNzbuild-system)ospathjoinioopenr   )
source_dir	pyprojectfZpyproject_datar   r   r   load_system   s    &r   c              	   C   sH   zt | }W n ttfy&   i }Y n0 |dd |dddg |S )z
    Given a source dir, attempt to get a build system backend
    and requirements from pyproject.toml. Fallback to
    setuptools but only if the file was not found or a build
    system was not indicated.
    r
   z setuptools.build_meta:__legacy__r	   
setuptoolswheel)r   r   KeyError
setdefault)r   r   r   r   r   compat_system'   s    
r#   c              
   C   s   dj f i t }t| |}|i }td| || td t p}td|| dj f i t }t| |}	|	|i }
tj	||
}t
|tj	|tj|
 W d    n1 s0    Y  d S )Nzget_requires_for_build_{dist}zGot build requires: %sz$Installed dynamic build dependencieszTrying to build %s in %szbuild_{dist})r   localsgetattrloginfopip_installr   r   r   r   shutilmovebasename)hooksenvdistdestZget_requires_nameget_requiresreqstdZ
build_namebuildfilenamesourcer   r   r   	_do_build:   s    




r6   c                 C   s   |p
t | }tj| |pd}t| t| t| |d |d}t ,}|	|d  t
|||| W d    n1 s|0    Y  d S )Nr.   r
   zbackend-pathr	   )r   r   r   r   r   r   r   getr   r(   r6   )r   r.   r/   r   r,   r-   r   r   r   r3   L   s    r3   r   z%A directory containing pyproject.toml)helpz--binaryz-b
store_trueF)actiondefaultz--sourcez-sz	--out-dirz-oz>Destination in which to save the builds relative to source dirc                 C   sZ   t d ttd | js| js dnd | js.| js2dnd f}|D ]}t| j|| j q@d S )NzQpep517.build is deprecated. Consider switching to https://pypi.org/project/build/sdistr    )	r&   warninglistfilterr5   binaryr3   r   Zout_dir)argsdistsr.   r   r   r   mainp   s    
rC   __main__)NN)__doc__argparser   loggingr   r)   Zenvbuildr   wrappersr   Zdirtoolsr   r   compatr   r   	getLogger__name__r&   r   r   r#   r6   r3   ArgumentParserparseradd_argumentrC   
parse_argsr   r   r   r   <module>   sJ   



