File: //proc/1233/root/usr/share/dh-python/dhpython/build/__pycache__/plugin_pyproject.cpython-310.pyc
o
O�Ib� � @ s� d dl mZ d dlZd dlmZ d dlZd dlZzd dlZW n e y' Y nw zd dl
mZ d dlm
Z
d dlmZ W n e yK d Z
ZZY nw d dlmZmZ e�d�ZG dd � d e�ZdS )
� )�PathN)�install)�SchemeDictionaryDestination)� WheelFile)�Base�
shell_command�dhpythonc s� e Zd ZdZddhZdgZi ZejdhB Z� fdd�Z � fdd �Z
d
d� Zdd
� Ze
dd� �Zdd� Zdd� Ze
� fdd��Z� ZS )�BuildSystemzGeneric PEP517 build system�python3zpython{version}�pyproject.toml�buildc s� t � �|�}|d8 }z,tdd��
}t�|�}W d � n1 s w Y |�di ��d�r3|d7 }nd}W n tyA d}Y n tyK d}Y nw |d krRd S |S )
a] Return certainty level that this plugin describes the right build
system
This method uses cls.{REQUIRED}_FILES (pyroject.toml) only; any
other PEP517 compliant builder (such as the flit) builder should
indicate higher specificity than this plugin.
:return: 0 <= certainty <= 100
:rtype: int
� r �rbNzbuild-systemz
build-backend�
r �d )�super�detect�open�tomli�load�get� NameError�FileNotFoundError)�self�context�result�f� pyproject�� __class__� �7/usr/share/dh-python/dhpython/build/plugin_pyproject.pyr 4 s$ �
��zBuildSystem.detectc sP t � �||� t�|d �� �r&t�d|d � t�|d �o%t� |d � dS )N�interpreterz'removing '%s' (and everything under it)� build_dirr )
r �clean�osp�exists�binary�log�debug�isdir�shutil�rmtree�r r �argsr r r! r$ U s ��zBuildSystem.cleanc C s t d u rtd��dS )Nz^PEP517 plugin dependencies are not available. Please Build-Depend on pybuild-plugin-pyproject.r )r � Exceptionr- r r r! � configure] s zBuildSystem.configurec C s | � ||� | �||� d S �N)�build_step1�build_step2r- r r r! r d s zBuildSystem.buildc C s, t �d|d � d|d d<