ruạṛ
a �u:j� � @ s� d Z ddlZddlZddlZddlZddlZddlmZ ddlZddl m Z ddlmZ eej jdd�ZG d d � d �ZG dd� d�Zd d� Zdd� ZdS )z$Test .dist-info style distributions.� N)�partial)�unpack_archive� )�DALS�utf-8��encodingc @ s2 e Zd Zdd� Zdd� Zej�dd�dd� �Zd S ) �TestDistInfoc C sh d}|d j |dd� t�dtjtjB �}td|dd�}|jsBJ �|�|j�sRJ �t |� d ��rdJ �d S )zA Supplying an invalid version crashes dist_info. z@[metadata] name=proj version=42 [egg_info] tag_build=invalid!!! � setup.cfgr r zinvalid version� dist_infoF)�cwd�check�*.dist-infoN)� write_text�re�compile� MULTILINE� IGNORECASE�run_command_inner� returncode�search�stdout�list�glob)�self�tmp_path�config�msg�proc� r �R/opt/bart/bart_venv/lib/python3.9/site-packages/setuptools/tests/test_dist_info.py�test_invalid_version s z!TestDistInfo.test_invalid_versionc C s� d}|d j |dd� ttdd|d�� t|�d��}|j�d �sFJ �t�|� ttdd d|d�� t|�d��}|j�d�s�J �d S ) Nz [metadata] name=proj version=42 [egg_info] tag_date=1 tag_build=.post r r r r z --no-date�r r zproj-42z--tag-buildz.azproj-42a) r �print�run_command�nextr �name� startswith�shutil�rmtree)r r r r r r r �test_tag_arguments s zTestDistInfo.test_tag_arguments� keep_egg_info)FTc C s� d}|d j |dd� |d }|�� |r0dgng }tdd|g|�R d |i� tt|�d ���dkshJ �tt|�d ���dks�J �t|�}tt|�d ���|ks�J �tt|�d ���dks�J �tt|�d���dks�J �tt|�d���dks�J �d S )Nz [metadata] name=proj version=42 r r r Z__outz--keep-egg-infor z--output-dirr r r r z *.egg-infoz *.__bkp__)r �mkdirr$ �lenr r �int)r r r+ r �out�optsZexpected_egg_infor r r �test_output_dir4 s zTestDistInfo.test_output_dirN) �__name__� __module__�__qualname__r! r* �pytest�mark�parametrizer1 r r r r r s r c @ sX e Zd ZdZed�Zg d�Zej� dd� � �ej� ddg�ej� de�d d � ���ZdS )�TestWheelCompatibilityz�Make sure the .dist-info directory produced with the ``dist_info`` command is the same as the one produced by ``bdist_wheel``. ae [metadata] name = {name} version = {version} [options] install_requires = foo>=12; sys_platform != "linux" [options.extras_require] test = pytest [options.entry_points] console_scripts = executable-name = my_package.module:function discover = myproj = my_package.other_module:function ))� r9 )�.postz[egg_info] tag_build = post )r: z[egg_info] tag_build = .post )r: z)[egg_info] tag_build = post tag_date = 1 )�.devz[egg_info] tag_build = .dev )r; z)[egg_info] tag_build = .dev tag_date = 1 )Za1z[egg_info] tag_build = .a1 )z+localz[egg_info] tag_build = +local r&