HEX
Server: Apache/2.4.65 (Debian)
System: Linux kubikelcreative 5.10.0-35-amd64 #1 SMP Debian 5.10.237-1 (2025-05-19) x86_64
User: www-data (33)
PHP: 8.4.13
Disabled: NONE
Upload Files
File: //usr/share/dh-python/dhpython/build/__pycache__/plugin_flit.cpython-39.pyc
a

��:`��@s�ddlZddlmZmZmZddlZddlmZddlm	Z	ddl
Z
zddlZWneybYn0zddl
mZWney�eZYn0ddlmZe�d�ZGdd�de�ZGd	d
�d
e�ZdS)�N)�exists�isdir�join)�Path)�	Installer)�BaseZdhpythonc@seZdZdd�ZdS)�DebianInstallercCsv|dd�tjkr|dd�}|j|jd�}t�||�|d<||d|d<tj|ddd�tj|ddd�t�|dt�|jj	��}t�
|�r�t�|�r�t�|�s�t
�|�n
t�|�t|jj	�}|jjr�t�d||�t
�||�|�|�n&t�d	||�t
�||�|j�|�|jj�d
i�}|�rT|�||d�t�d|d�|�|d�t�d|d�dS)
z\Install a module/package into package directory, and create its
           scripts.
        N�)�userZpurelib�scriptsT)�exist_okzInstalling package %s -> %szInstalling file %s -> %sZconsole_scriptszInstalling scripts to %szWriting dist-info %s)�os�sepZ	_get_dirsr
�ospr�makedirs�basename�module�path�lexistsr�islink�shutil�rmtree�unlink�str�
is_package�log�infoZcopytreeZ_record_installed_directoryZcopy2Zinstalled_files�appendZini_infoZentrypoints�getZinstall_scriptsZwrite_dist_info)�self�destdirZ
installdir�dirsZdst�srcr�r#�2/usr/share/dh-python/dhpython/build/plugin_flit.py�install_directly,s4

z DebianInstaller.install_directlyN)�__name__�
__module__�__qualname__r%r#r#r#r$r+srcsbeZdZdZddhZdgZiZejdhBZ�fdd�Z	�fdd	�Z
d
d�Zdd
�Zdd�Z
�ZS)�BuildSystemzFlit build system�python3zpython{version}�pyproject.toml�buildcs�tturdSt��|�}z4tj�d�}|�di��d�dkrF|d7}nd}Wn*tybd}Ynt	yvd}Yn0|dkr�dS|S)a�Return certainty level that this plugin describes the right build
        system

        This method uses cls.{REQUIRED}_FILES (pyroject.toml) as well as
        checking to see if build-backend is set to flit_core.buildapi.

        Score is 95 if both are present (to allow manually setting distutils to
        score higher if set).

        :return: 0 <= certainty <= 100
        :rtype: int
        rr+zbuild-systemz
build-backendzflit_core.buildapi�-�d)
r�object�super�detect�toml�decoder�loadr�	NameError�FileNotFoundError)r�context�resultZ	pyproject��	__class__r#r$r1Ys"
�

zBuildSystem.detectcsLt��||�t|d���rHt�d|d�t|d�oFt�|d�dS)NZinterpreterz'removing '%s' (and everything under it)�	build_dirr)	r0�cleanrZbinaryr�debugrrr�rr7�argsr9r#r$r<|s�zBuildSystem.cleancCsdS)Nrr#r>r#r#r$�	configure�szBuildSystem.configurecCs>t|d�}dddd�}tj|dfi|���|dd�dS)	N�dirF�none�r
�symlinkZdepsr+r;�r�rrZ
from_ini_pathr%�rr7r?Zmy_dirZinstall_kwargsr#r#r$r,�s��zBuildSystem.buildcCsBt|d�}dddd�}tj|dfi|���|d|d�dS)	NrAFrBrCr+r Zinstall_dirrrFrGr#r#r$�install�s��zBuildSystem.install)r&r'r(ZDESCRIPTIONZSUPPORTED_INTERPRETERSZREQUIRED_FILESZOPTIONAL_FILESrZCLEAN_FILESr1r<r@r,rH�
__classcell__r#r#r9r$r)Rs#	r))Zlogging�os.pathrrrr
rr�pathlibrrr2�ModuleNotFoundErrorZflit.installr�ImportErrorr/Zdhpython.build.baserZ	getLoggerrrr)r#r#r#r$�<module>s"

'