HEX
Server: Apache/2.4.52 (Ubuntu)
System: Linux spn-python 5.15.0-89-generic #99-Ubuntu SMP Mon Oct 30 20:42:41 UTC 2023 x86_64
User: arjun (1000)
PHP: 8.1.2-1ubuntu2.20
Disabled: NONE
Upload Files
File: //proc/1233/cwd/usr/share/dh-python/dhpython/build/__pycache__/plugin_pyproject.cpython-310.pyc
o

O�Ib��@s�ddlmZddlZddlmZddlZddlZzddlZWn	e	y'Ynwzddl
mZddlm
Z
ddlmZWne	yKdZ
ZZYnwddlmZmZe�d�ZGdd	�d	e�ZdS)
�)�PathN)�install)�SchemeDictionaryDestination)�	WheelFile)�Base�
shell_command�dhpythoncs�eZdZdZddhZdgZiZejdhBZ�fdd�Z	�fdd	�Z
d
d�Zdd
�Ze
dd��Zdd�Zdd�Ze
�fdd��Z�ZS)�BuildSystemzGeneric PEP517 build system�python3zpython{version}�pyproject.toml�buildcs�t��|�}|d8}z,tdd��
}t�|�}Wd�n1s wY|�di��d�r3|d7}nd}WntyAd}YntyKd}Ynw|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�rbNzbuild-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.pyr4s$�
��zBuildSystem.detectcsPt��||�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�rr�argsrr r!r$Us��zBuildSystem.cleancCstdurtd��dS)Nz^PEP517 plugin dependencies are not available. Please Build-Depend on pybuild-plugin-pyproject.r)r�	Exceptionr-r r r!�	configure]szBuildSystem.configurecCs|�||�|�||�dS�N)�build_step1�build_step2r-r r r!rdszBuildSystem.buildcCs,t�d|d�d|dd<d|ddS)	z< build a wheel using the PEP517 builder defined by upstream z)Building wheel for %s with "build" moduler"�1�ENV�FLIT_NO_NETWORKzO{interpreter} -m build --skip-dependency-check --no-isolation --wheel --outdir �home_dirz {args})r(�infor-r r r!r2hs���zBuildSystem.build_step1c	Cs�t�d|d�|d�d|dj��}t�|�r t�d�dSt|d|d||dd�|djdd	�}t|d
��	d�}|D]-}|j
�d�rQtd
|j
�d���t
�|��}t||id�Wd�n1shwYq@dS)z) unpack the wheel into pybuild's normal  z4Unpacking wheel built for %s with "installer" moduler"r#z	/scripts-z[Scripts directory already exists, skipping unpack. Is the Python package being built twice?N)�platlib�purelib�scripts�data�posix)r"�script_kindr7z*.whl�UNKNOWNzUNKNOWN wheel found: z.. Does pyproject.toml specify a build-backend?)�source�destination�additional_metadata)r(r8�versionr%r&�warningr�	binary_dvr�glob�name�
startswithr/rrr)rrr.r;rA�wheels�wheelr@r r r!r3ts:�

������zBuildSystem.build_step2cCs�t�d|d�ztjdd�}Wntytjdd�}Ynwt|d��d�D]}|d|d	}t�d
||�tj	||dd�q)|d}|d|d
}t�d||�tj	||t�
d�dd�dS)Nz'Copying package built for %s to destdirr"�
deb_system)�scheme�posix_prefixr#z	scripts-*�destdirr;z0Copying scripts directory contents from %s -> %sT)�
dirs_exist_ok�install_dirz%Copying module contents from %s -> %s)�ignorerO)r(r8�	sysconfig�	get_paths�KeyErrorrrFr)r+�copytree�ignore_patterns)rrr.�paths�
script_dir�
target_dir�
module_dirr r r!r�s:�����
�zBuildSystem.installcst��||�Sr1)r�testr-rr r!r[�szBuildSystem.test)�__name__�
__module__�__qualname__�DESCRIPTION�SUPPORTED_INTERPRETERS�REQUIRED_FILES�OPTIONAL_FILESr�CLEAN_FILESrr$r0rrr2r3rr[�
__classcell__r r rr!r	-s !
)!r	)�pathlibr�logging�os.path�pathr%r+rRr�ModuleNotFoundError�	installerr�installer.destinationsr�installer.sourcesr�dhpython.build.baserr�	getLoggerr(r	r r r r!�<module>s(��