ruạṛ
a �u:j � @ s� d Z ddlZddlZddlZddlZddlZddlZddlZddlm Z ddl Z ddlmZ e j �d�G dd� d��ZG dd � d �Zd d� Zdd � Zdd� Zdd� ZdS )z&Support code for distutils test cases.� N)�Distribution)�always_iterableZdistutils_managed_tempdirc @ s, e Zd ZdZdd� Zddd�Zddd �Zd S ) �TempdirManagerzI Mix-in class that handles temporary directories for test cases. c C s t �� }| j�|� |S )zjCreate a temporary directory that will be cleaned up. Returns the path of the directory. )�tempfile�mkdtempZtempdirs�append)�self�d� r �V/opt/bart/bart_venv/lib/python3.9/site-packages/setuptools/_distutils/tests/support.pyr s zTempdirManager.mkdtemp�xxxc C s t jt|�� j|dd� dS )zVWrites a file in the given path. path can be a string or a sequence. zutf-8)�encodingN)�pathlib�Pathr � write_text)r �path�contentr r r � write_file s zTempdirManager.write_file�fooc K s2 | � � }tj�||�}t�|� t|d�}||fS )a Will generate a test environment. This function creates: - a Distribution instance using keywords - a temporary directory with a package structure It returns the package directory and the distribution instance. )�attrs)r �osr �join�mkdirr )r �pkg_name�kwZtmp_dirZpkg_dir�distr r r �create_dist&