
    @[h                        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ZddlZddlm	Z	 ddlm
Z ddlmZ ddlmZ ddlm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dZdddddZd Z edk    r e             dS dS )zHCheck a project and backend by attempting to build using PEP 517 hooks.
    N)isfile)join)CalledProcessError)mkdtemp   )tomllib)enable_colourful_output)BuildEnvironment)Pep517HookCallerc                    t                      5 }	 |                    |           t                              d           n6# t          $ r) t                              d           Y d d d            dS w xY w	 |                     i           }t                              d|           n8# t          $ r+ t                              dd           Y d d d            dS w xY w	 |                    |           t                              d           n6# t          $ r) t                              d	           Y d d d            dS w xY wt                      }t                              d
|           	 	 | 	                    |i           }t                              d|           nL# t          $ r? t                              dd           Y t          j        |           d d d            dS w xY w|                    d          s=t                              d|           	 t          j        |           d d d            dS t          ||          }t          |          rt                              d|           n=t                              d|           	 t          j        |           d d d            dS t          j        |          rt                              d           n<t                              d           	 t          j        |           d d d            dS 	 t          j        |           n# t          j        |           w xY w	 d d d            dS # 1 swxY w Y   d S )N#Installed static build dependencies+Failed to install static build dependenciesFGot build requires: %s'Failure in get_requires_for_build_sdistTexc_info$Installed dynamic build dependencies,Failed to install dynamic build dependencieszTrying to build sdist in %szbuild_sdist returned %rzFailure in build_sdistz.tar.gzz*Filename %s doesn't have .tar.gz extensionOutput file %s existsOutput file %s does not existzOutput file is a tar filezOutput file is not a tar file)r
   pip_installloginfor   errorget_requires_for_build_sdist	Exceptionr   build_sdistshutilrmtreeendswithpjoinr   tarfile
is_tarfilehooksbuild_sys_requiresenvreqstdfilenamepaths          g/var/www/api.easyaligner.net/htdocs/venv_linux/lib/python3.11/site-packages/pip/_vendor/pep517/check.pycheck_build_sdistr-      s   			 5s	OO.///HH:;;;;! 	 	 	IICDDD5 5 5 5 5 5 5 5		55b99DHH-t4444 	 	 	II?$IOOO5 5 5 5 5 5 5 5		OOD!!!HH;<<<<! 	 	 	IIDEEE)5 5 5 5 5 5 5 5$	 YY.333	 ,,R442H====   1DAAA* M"g5 5 5 5 5 5 5 58 $$Y// 		@(L L L  M"g5 5 5 5 5 5 5 5J X&&Dd|| 0$7777		94@@@ M"g5 5 5 5 5 5 5 5X !$'' 45555		9::: M"g5 5 5 5 5 5 5 5Z 6 M"FM"k5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5   M#/A M#$A4%M#3A44M#80B)(M#)&CM#CM#"/DM#$E6M#E,M#31F%$L<%&G.L<M#-G..3L<"M#AL<M#;A	L<M#'M#<MM##M'*M'c                    t                      5 }	 |                    |           t                              d           n6# t          $ r) t                              d           Y d d d            dS w xY w	 |                     i           }t                              d|           n8# t          $ r+ t                              dd           Y d d d            dS w xY w	 |                    |           t                              d           n6# t          $ r) t                              d	           Y d d d            dS w xY wt                      }t                              d
|           	 	 | 	                    |i           }t                              d|           nL# t          $ r? t                              dd           Y t          j        |           d d d            dS w xY w|                    d          s=t                              d|           	 t          j        |           d d d            dS t          ||          }t          |          rt                              d|           n=t                              d|           	 t          j        |           d d d            dS t          j        |          rt                              d           n<t                              d           	 t          j        |           d d d            dS 	 t          j        |           n# t          j        |           w xY w	 d d d            dS # 1 swxY w Y   d S )Nr   r   Fr   r   Tr   r   r   zTrying to build wheel in %szbuild_wheel returned %rzFailure in build_wheelz.whlz'Filename %s doesn't have .whl extensionr   r   zOutput file is a zip filezOutput file is not a zip file)r
   r   r   r   r   r   get_requires_for_build_wheelr   r   build_wheelr   r   r    r!   r   zipfile
is_zipfiler$   s          r,   check_build_wheelr4   P   sx   			 4s	OO.///HH:;;;;! 	 	 	IICDDD4 4 4 4 4 4 4 4		55b99DHH-t4444 	 	 	II?$IOOO4 4 4 4 4 4 4 4		OOD!!!HH;<<<<! 	 	 	IIDEEE)4 4 4 4 4 4 4 4$	 YY.333	 ,,R442H====   1DAAA( M"e4 4 4 4 4 4 4 48 $$V,, 		CXNNN  M"e4 4 4 4 4 4 4 4H X&&Dd|| 0$7777		94@@@ M"e4 4 4 4 4 4 4 4V !$'' 45555		9::: M"e4 4 4 4 4 4 4 4X 6 M"FM"i4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4r.   c                     t          | d          }t          |          rt                              d           nt                              d           dS 	 t          |d          5 }t          j        |          }d d d            n# 1 swxY w Y   |d         }|d         }|d         }|                    d	          }t                              d
           n9# t          j	        t          f$ r  t                              dd           Y dS w xY wt          | ||          }t          ||          }	t          ||          }
|	st                              d           |
st                              d           |	S )Nzpyproject.tomlzFound pyproject.tomlzMissing pyproject.tomlFrbzbuild-systemrequireszbuild-backendzbackend-pathzLoaded pyproject.tomlzInvalid pyproject.tomlTr   z%Sdist checks failed; scroll up to seezWheel checks failed)r!   r   r   r   r   openr   loadgetTOMLDecodeErrorKeyErrorr   r-   r4   warning)
source_dir	pyprojectfpyproject_databuildsysr7   backendbackend_pathr%   sdist_okwheel_oks              r,   checkrG      s   j"233Ii '((((		*+++u)T"" 	-a$\!__N	- 	- 	- 	- 	- 	- 	- 	- 	- 	- 	- 	- 	- 	- 	- ".1J'?+||N33())))#X.   		*T	:::uu Z,??E 11H 11H =;<<< +)***Os7   C (B	=C 	BC BA
C 2DDc                    t                               d           t          j                    }|                    dd           |                    |           }t                       t          |j                  }|rt          t          dd                     d S t          t          dd                     t          j        d	           d S )
NzQpep517.check is deprecated. Consider switching to https://pypi.org/project/build/r>   z%A directory containing pyproject.toml)helpzChecks passedgreenzChecks failedredr   )r   r=   argparseArgumentParseradd_argument
parse_argsr	   rG   r>   printansisysexit)argvapargsoks       r,   mainrX      s    KK H I I I 
	 	"	"BOO4  6 6 6 ==D	t		B	 d?G,,-----d?E**+++    z[0mz[1mz[31mz[32m)resetboldrK   rJ   c                     t           j        dk    rIt          j                                        r+t
          |         t          |           z   t
          d         z   S t          |           S )NntrZ   )osnamerR   stdoutisatty
ansi_codesstr)sattrs     r,   rQ   rQ      sJ    	w$3:,,..$#a&&(:g+>>>1vvrY   __main__)N)!__doc__rL   loggingr^   r   rR   r"   r2   os.pathr   r   r!   
subprocessr   tempfiler   _compatr   colorlogr	   envbuildr
   wrappersr   	getLogger__name__r   r-   r4   rG   rX   rb   rQ    rY   r,   <module>rs      s      				  



         ! ! ! ! ! ! ) ) ) ) ) )             - - - - - - & & & & & & & & & & & &g!!6 6 6r5 5 5p  D   , 	 
   zDFFFFF rY   