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_distutils.cpython-39.pyc
a

��:`H�@s~ddlZddlmZddlmZddlmZmZmZddl	m
Z
ddlmZm
Z
mZe�d�ZdZd	d
�ZGdd�de�ZdS)
�N)�glob1)�remove)�exists�isdir�join)�rmtree)�Base�
shell_command�copy_test_filesZdhpythonzsetup.py|setup-3.pycs�fdd�}�j|_|S)z�distutils doesn't have sane command-line API - this decorator creates
    .pydistutils.cfg file to workaround it

    hint: if you think this is plain stupid, please don't read
    distutils/setuptools/distribute sources
    c
s�t|dd�}t|�s�t|ddd��X}dddd	�|d
�ddd
dd�|d�dg
}t�dd�|��|�|�Wd�n1s�0Y|d|dd<�|||g|�Ri|��S)NZhome_dirz.pydistutils.cfg�wzutf-8)�encodingz[clean]
zall=1
z[build]
z
build-lib={}
�	build_dirz
[install]
zforce=1
zinstall-layout=deb
zinstall-scripts=$base/bin
zinstall-lib={}
Zinstall_dirzprefix=/usr
zpydistutils config file:
%s�ZENV�HOME)rr�open�format�log�debug�
writelines)�self�context�argsZoargs�kwargs�fpath�fp�lines��func��7/usr/share/dh-python/dhpython/build/plugin_distutils.py�wrapped_func(s$�
(z,create_pydistutils_cfg.<locals>.wrapped_func)�__name__)rr rrr�create_pydistutils_cfg sr"cs�eZdZdZhd�ZegZddddd�Zej	dhBZ	�fdd�Z
ee�fd	d
���Z
eedd���Zeed
d���Zeedd���Zeee��fdd����Z�ZS)�BuildSystemzDistutils build system>�pythonzpython{version}zpython{version}-dbgZpypy�python3z
python-dbgzpython3-dbg��
)z	setup.cfgzrequirements.txtzPKG-INFO�
*.egg-info�buildcsBtt|��|�}t|jvr2|jtd|dd<nd|dd<|S)Nrr�setup_pyzsetup.py)�superr#�detect�
_setup_tplZDETECTED_REQUIRED_FILES)rr�result��	__class__rrr,Ks

zBuildSystem.detectcs*tt|��||�t|d���r&dSdS)NZinterpreterz%{interpreter} {setup_py} clean {args}r)r+r#�cleanrZbinary�rrrr/rrr1SszBuildSystem.cleancCsdS)Nz&{interpreter} {setup_py} config {args}rr2rrr�	configure[szBuildSystem.configurecCsdS)Nz/{interpreter.binary_dv} {setup_py} build {args}rr2rrrr)`szBuildSystem.buildcCs>t|dd�D]*}t|d|�}t|�r0t|�nt|�qdS)Nr
r(zB{interpreter.binary_dv} {setup_py} install --root {destdir} {args})rrrrr)rrr�fnamerrrr�installeszBuildSystem.installcsx|jjsft|d|d�}t|d��2}|���d�dkrHWd�dSWd�n1s\0Ytt|��||�S)N�dirr*�rbs
test_suiterz${interpreter} {setup_py} test {args})	ZcfgZcustom_testsrr�read�findr+r#�test)rrrrrr/rrr:os.zBuildSystem.test)r!�
__module__�__qualname__ZDESCRIPTIONZSUPPORTED_INTERPRETERSr-ZREQUIRED_FILESZOPTIONAL_FILESrZCLEAN_FILESr,r	r"r1r3r)r5r
r:�
__classcell__rrr/rr#?s4�r#)ZloggingZglobr�osr�os.pathrrrZshutilrZdhpython.build.baserr	r
Z	getLoggerrr-r"r#rrrr�<module>s