a
€™ReÄ ã @ sô d Z ddlZddlZddlZddlZddlmZmZ ddl Z ddl
mZ ddlZddl
Z
ddlmZ ddlZddlmZ ddlmZmZ dd lmZ dd
lmZ e e¡Zdd„ Zd
d„ Zdd„ Zddd„Z dddddœZ!dd„ Z"edkrðe ƒ dS )zHCheck a project and backend by attempting to build using PEP 517 hooks.
é N)ÚisfileÚjoin)ÚCalledProcessError)Úmkdtempé )Úenable_colourful_output)ÚTOMLDecodeErrorÚ toml_load)ÚBuildEnvironment)ÚPep517HookCallerc
C sH t ƒ *}z| |¡ t d¡ W n* tyL t d¡ Y W d ƒ dS 0 z| i ¡}t d|¡ W n. ty– tjddd Y W d ƒ dS 0 z| |¡ t d¡ W n* tyÚ t d ¡ Y W d ƒ dS 0 tƒ }t d
|¡ z$z| |i ¡}t d|¡ W n< tyJ tjddd Y W t
|¡ W d ƒ dS 0 | d
¡s€t d|¡ W t
|¡ W d ƒ dS t
||ƒ}t|ƒr¢t d|¡ n(t d|¡ W t
|¡ W d ƒ dS t |¡rât d¡ n&t d¡ W t
|¡ W d ƒ dS W t
|¡ nt
|¡ 0 W d ƒ dS 1 s:0 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 dependencieszTrying to build sdist in %szbuild_sdist returned %rzFailure in build_sdistz.tar.gzz*Filename %s doesn't have .tar.gz extensionúOutput file %s existsúOutput file %s does not existzOutput file is a tar filezOutput 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©ÚhooksZbuild_sys_requiresÚenvÚreqsÚtdÚfilenameÚpath© 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/check.pyÚcheck_build_sdist sh
ëÿ
ð
÷
ýr, c
C sH t ƒ *}z| |¡ t d¡ W n* tyL t d¡ Y W d ƒ dS 0 z| i ¡}t d|¡ W n. ty– tjddd Y W d ƒ dS 0 z| |¡ t d¡ W n* tyÚ t d ¡ Y W d ƒ dS 0 tƒ }t d
|¡ z$z| |i ¡}t d|¡ W n< tyJ tjddd Y W t
|¡ W d ƒ dS 0 | d
¡s€t d|¡ W t
|¡ W d ƒ dS t
||ƒ}t|ƒr¢t d|¡ n(t d|¡ W t
|¡ W d ƒ dS t |¡rât d¡ n&t d¡ W t
|¡ W d ƒ dS W t
|¡ nt
|¡ 0 W d ƒ dS 1 s:0 Y d S )Nr r
Fr r Tr r r zTrying to build wheel in %szbuild_wheel returned %rzFailure in build_wheelz.whlz'Filename %s doesn't have .whl extensionr r zOutput file is a zip filezOutput 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# r* r* r+ Úcheck_build_wheelP sd
ì
ð
÷
ýr1 c C sø t | dƒ}t|ƒrt d¡ nt d¡ dS zdt |d¡}t|ƒ}W d ƒ n1 sX0 Y |d }|d }|d }| d ¡}t d
¡ W n& t t
fy¶ tjddd
Y dS 0 t| ||ƒ}t||ƒ} t
||ƒ}
| sæt d¡ |
sôt d¡ | S )Nzpyproject.tomlzFound pyproject.tomlzMissing pyproject.tomlFÚrbzbuild-systemÚrequiresz
build-backendzbackend-pathzLoaded pyproject.tomlzInvalid pyproject.tomlTr z%Sdist checks failed; scroll up to seezWheel checks failed)r r r r r ÚioÚopenr Úgetr ÚKeyErrorr r, r1 Úwarning)Ú
source_dirÚ pyprojectÚfZpyproject_dataZbuildsysr3 ÚbackendÚbackend_pathr$ Zsdist_okZwheel_okr* r* r+ Úcheckˆ s0
&
r> c C sj t d¡ t ¡ }|jddd | | ¡}tƒ t|jƒ}|rNt t
ddƒƒ nt t
ddƒƒ t d ¡ d S )
NzQpep517.check is deprecated. Consider switching to https://pypi.org/project/build/r9 z%A directory containing pyproject.toml)Úhelpz
Checks passedÚgreenz
Checks failedÚredr )
r r8 ÚargparseÚArgumentParserÚadd_argumentÚ
parse_argsr r> r9 ÚprintÚansiÚsysÚexit)ÚargvZapÚargsÚokr* r* r+ Úmainª s
þ
rM z[0mz[1mz[31mz[32m)ÚresetÚboldrA r@ c C s8 t jdkr,tj ¡ r,t| t| ƒ td S t| ƒS d S )NÚntrN )ÚosÚnamerH ÚstdoutÚisattyÚ
ansi_codesÚstr)ÚsÚattrr* r* r+ rG Ç s rG Ú__main__)N)#Ú__doc__rB r4 ÚloggingrQ Úos.pathr r r r Ú
subprocessr rH r! Útempfiler r/ Zcolorlogr Úcompatr r Zenvbuildr
Úwrappersr Ú getLoggerÚ__name__r r, r1 r> rM rU rG r* r* r* r+ Ú