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: //usr/share/dh-python/dhpython/build/__pycache__/plugin_distutils.cpython-310.pyc
o

O�IbH�@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_files�dhpythonzsetup.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|�sFt|ddd��,}dddd	�|d
�ddd
dd�|d�dg
}t�dd�|��|�|�Wd�n1sAwY|d|dd<�|||g|�Ri|��S)N�home_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={}
�install_dirzprefix=/usr
zpydistutils config file:
%s��ENV�HOME)rr�open�format�log�debug�
writelines)�self�context�args�oargs�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__)r"r%r#r!r$�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>�
python-dbg�python3-dbg�python{version}�python{version}-dbg�pypy�python�python3��
)z	setup.cfgzrequirements.txtzPKG-INFO�
*.egg-info�buildcsDtt|��|�}t|jvr|jtd|dd<|Sd|dd<|S)Nrr�setup_pyzsetup.py)�superr(�detect�
_setup_tpl�DETECTED_REQUIRED_FILES)rr�result��	__class__r#r$r6Ks
�zBuildSystem.detectcs*tt|��||�t|d���rdSdS)N�interpreterz%{interpreter} {setup_py} clean {args}r)r5r(�cleanr�binary�rrrr:r#r$r=SszBuildSystem.cleancC�dS)Nz&{interpreter} {setup_py} config {args}r#r?r#r#r$�	configure[�zBuildSystem.configurecCr@)Nz/{interpreter.binary_dv} {setup_py} build {args}r#r?r#r#r$r3`rBzBuildSystem.buildcCs>t|dd�D]}t|d|�}t|�rt|�nt|�qdS)Nrr2zB{interpreter.binary_dv} {setup_py} install --root {destdir} {args})rrrrr)rrr�fnamerr#r#r$�installes
�zBuildSystem.installcsz|jjs4t|d|d�}t|d��}|���d�dkr%	Wd�dSWd�n1s/wYtt|��||�S)N�dirr4�rbs
test_suiterz${interpreter} {setup_py} test {args})	�cfg�custom_testsrr�read�findr5r(�test)rrrrrr:r#r$rKos��zBuildSystem.test)r&�
__module__�__qualname__�DESCRIPTION�SUPPORTED_INTERPRETERSr7�REQUIRED_FILES�OPTIONAL_FILESr�CLEAN_FILESr6r	r'r=rAr3rDr
rK�
__classcell__r#r#r:r$r(?s6�r()�logging�globr�osr�os.pathrrr�shutilr�dhpython.build.baserr	r
�	getLoggerrr7r'r(r#r#r#r$�<module>s