a ˆljÄ ã @ 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 ÚerrorZget_requires_for_build_sdistÚ Exceptionr Zbuild_sdistÚshutilÚrmtreeÚendswithÚpjoinr ÚtarfileZ is_tarfile©ÚhooksZbuild_sys_requiresÚenvZreqsZtdÚfilenameÚpath© r% ú