
    @[hs                        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  ej        e          Zd Zd Zd	 Zd
 ZddZ ej                    Ze                    dd           e                    dddd           e                    dddd           e                    ddd           d Zedk    r ee                                           dS dS )z%Build a project using PEP 517 hooks.
    N   )tomllib)BuildEnvironment)Pep517HookCallerc                     ddh}|t          |           k    s5d                    |t          |           z
            }t          |          dS )z7
    Ensure build system has the requisite fields.
    requiresbuild-backendz"Missing required fields: {missing})missingN)setformat
ValueError)systemrequiredmessages      g/var/www/api.easyaligner.net/htdocs/venv_linux/lib/python3.11/site-packages/pip/_vendor/pep517/build.pyvalidate_systemr      s_     O,HF##6==S[[( > 
 
 !!!	 $#    c                     t           j                            | d          }t          |d          5 }t	          j        |          }ddd           n# 1 swxY w Y   |d         S )zC
    Load the build system from a source dir (pyproject.toml).
    zpyproject.tomlrbNzbuild-system)ospathjoinopenr   load)
source_dir	pyprojectfpyproject_datas       r   load_systemr      s     Z)9::I	i		 )! a) ) ) ) ) ) ) ) ) ) ) ) ) ) ).))s   AAAc                     	 t          |           }n# t          t          f$ r i }Y nw xY w|                    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   FileNotFoundErrorKeyError
setdefault)r   r   s     r   compat_systemr&   &   s    Z((x(   
*   j<"9:::Ms    ((c           
          dj         di t                      }t          | |          } |i           }t                              d|           |                    |           t                              d           t          j                    5 }t                              d||            dj         di t                      }t          | |          }	 |	|i           }
t          j	        
                    ||
          }t          j        |t          j	        
                    |t          j	                            |
                               d d d            d S # 1 swxY w 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_installtempfileTemporaryDirectoryr   r   r   shutilmovebasename)hooksenvdistdestget_requires_nameget_requiresreqstd
build_namebuildfilenamesources               r   	_do_buildr?   9   s   >7>JJJJ5"344L<DHH%t,,,OODHH3444		$	&	& L"+T2666*^*66VXX66
z**5R==b(++FBGLLrw/?/?/I/IJJKKKL L L L L L L L L L L L L L L L L Ls   CE!!E%(E%c                    |pt          |           }t          j                            | |pd          }t          j        |d           t          |           t          | |d         |                    d                    }t                      5 }|	                    |d                    t          ||||           d d d            d S # 1 swxY w Y   d S )Nr5   T)exist_okr	   zbackend-pathr   )r   r   r   r   makedirsr   r   getr   r-   r?   )r   r5   r6   r   r3   r4   s         r   r<   r<   K   s   .{:..F7<<
DNF33DKt$$$$FF?+VZZ-G-G E 
		 *sz*+++%dD)))* * * * * * * * * * * * * * * * * *s   .CCC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                     t                               d           t          t          d | j        s| j        sdnd | j        s| j        sdnd f                    }|D ]}t          | j        || j                   d S )NzQpep517.build is deprecated. Consider switching to https://pypi.org/project/build/sdistr"   )	r+   warninglistfilterr>   binaryr<   r   out_dir)argsdistsr5   s      r   mainrQ   o   s    KK H I I I ;;dk;t;;dk;t    E
  3 3dotT\22223 3r   __main__)NN)__doc__argparseloggingr   r0   r.   _compatr   envbuildr   wrappersr   	getLogger__name__r+   r   r   r&   r?   r<   ArgumentParserparseradd_argumentrQ   
parse_argsr(   r   r   <module>r_      s      				         & & & & & & & & & & & &g!!	" 	" 	"* * *  &L L L$* * * * 
!	 	"	"   	0           
       
   	I    3 3 3 zD				 r   