U
    *e                     @   s8   d dl mZ d dlmZ d
ddZdddZdd	 ZdS )   )AbstractProject)handle_exceptionNc              
   C   sN   t jdt|d}z|| W S  tk
rH } zt| W 5 d}~X Y nX dS )z= The PEP 517 hook for building an sdist from pyproject.toml. ZsdistZ	argumentsN)r   	bootstrap_convert_config_settingsbuild_sdist	Exceptionr   )Zsdist_directoryconfig_settingsprojecte r   +lib/python3.8/site-packages/sipbuild/api.pyr      s    r   c              
   C   sN   t jdt|d}z|| W S  tk
rH } zt| W 5 d}~X Y nX dS )z< The PEP 517 hook for building a wheel from pyproject.toml. Zwheelr   N)r   r   r   build_wheelr   r   )Zwheel_directoryr	   Zmetadata_directoryr
   r   r   r   r   r   +   s    r   c                 C   sb   | dkri } g }|   D ]D\}}|rRt|ts4|g}|D ]}||d |  q8q|| q|S )zW Return any configuration settings from the frontend to a pseudo-command
    line.
    N=)items
isinstancelistappend)r	   argsnamevalueZm_valuer   r   r   r   :   s    
r   )N)NN)Zabstract_projectr   
exceptionsr   r   r   r   r   r   r   r   <module>   s   

