관리-도구
편집 파일: check.cpython-38.pyc
U ʗ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 s t � ���}z|�|� t�d� W n* tk rL t�d� Y W 5 Q R � dS X z| �i �}t�d|� W n. tk r� tjddd� Y W 5 Q R � dS X z|�|� t�d� W n* tk r� t�d � Y W 5 Q R � dS X t� }t�d |� z�z| �|i �}t�d|� W n4 tk �r@ tjddd� Y W ��W 5 Q R � dS X |�d ��slt�d|� W ��W 5 Q R � dS t ||�}t|��r�t�d|� nt�d|� W �FW 5 Q R � dS t�|��r�t�d� nt�d� W �W 5 Q R � dS W 5 t � |� X W 5 Q R � dS Q R X 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 �shutil�rmtree�build_sdist�endswith�pjoinr �tarfile� is_tarfile��hooksZbuild_sys_requires�env�reqs�td�filename�path� r* ��/builddir/build/BUILDROOT/alt-python38-pip-22.2.1-2.el8.x86_64/opt/alt/python38/lib/python3.8/site-packages/pip/_vendor/pep517/check.py�check_build_sdist sZ � r, c C s t � ���}z|�|� t�d� W n* tk rL t�d� Y W 5 Q R � dS X z| �i �}t�d|� W n. tk r� tjddd� Y W 5 Q R � dS X z|�|� t�d� W n* tk r� t�d � Y W 5 Q R � dS X t� }t�d |� z�z| �|i �}t�d|� W n4 tk �r@ tjddd� Y W ��W 5 Q R � dS X |�d ��slt�d|� W ��W 5 Q R � dS t ||�}t|��r�t�d|� nt�d|� W �FW 5 Q R � dS t�|��r�t�d� nt�d� W �W 5 Q R � dS W 5 t � |� X W 5 Q R � dS Q R X 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 r r �build_wheelr r r �zipfile� is_zipfiler# r* r* r+ �check_build_wheelP sT r1 c C s� t | d�}t|�rt�d� nt�d� dS zPt�|d��}t|�}W 5 Q R X |d }|d }|d }|�d �}t�d � W n( t t fk r� tjddd � Y dS X 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>