File manager - Edit - /opt/saltstack/salt/lib/python3.10/site-packages/pip/_internal/distributions/__pycache__/sdist.cpython-310.pyc
Back
o ;j( � @ s� d dl mZ d dlZd dlmZ d dlmZ d dlmZ d dl m Z d dlmZ d dl mZ d d lmZ er<d d lmZ e�e�ZG dd� de �ZdS ) � )�annotationsN)�Iterable)� TYPE_CHECKING)�BuildEnvironment)�AbstractDistribution)�InstallationError)�BaseDistribution)�runner_with_spinner_message)�BuildEnvironmentInstallerc @ sn e Zd ZdZed%dd��Zd&dd�Zd'dd�Zd(dd�Zd)dd�Z d)dd�Z d(dd�Zd*dd�Zd+d"d#�Z d$S ),�SourceDistributionz�Represents a source distribution. The preparation step for these needs metadata for the packages to be generated, either using PEP 517 or using the legacy `setup.py egg_info`. �return� str | Nonec C s | j jsJ �| j jjS )z/Identify this requirement uniquely by its link.)�req�linkZurl_without_fragment��self� r �U/opt/saltstack/salt/lib/python3.10/site-packages/pip/_internal/distributions/sdist.py�build_tracker_id s z#SourceDistribution.build_tracker_idr c C s | j �� S )N)r Zget_distr r r r �get_metadata_distribution s z,SourceDistribution.get_metadata_distribution�build_env_installerr �build_isolation�bool�check_build_deps�Nonec C s� | j �� | j jo |}|r| �|� | j �� | �|� | j jo!|}|rF| j j}|d us.J �| j j�|�\}}|r?| � d|� |rF| � |� | j �� d S )N�the backend dependencies)r Zload_pyproject_tomlZ use_pep517�_prepare_build_backendZisolated_editable_sanity_check�_install_build_reqs�pyproject_requires� build_env�check_requirements�_raise_conflicts�_raise_missing_reqsZprepare_metadata) r r r r Zshould_isolateZshould_check_depsr �conflicting�missingr r r �prepare_distribution_metadata# s$ � z0SourceDistribution.prepare_distribution_metadatac C s� | j j}|d us J �t|�| j _| j jj|dd| j d� | j j�| j j�\}}|r/| �d|� |rHt� d| j � t� dd� ttt |���� d S d S )NZoverlayzbuild dependencies��kindZfor_reqz"PEP 517/518 supported requirementsz4Missing build requirements in pyproject.toml for %s.z`The project does not specify a build backend, and pip cannot fall back to setuptools without %s.z and )r r r r �install_requirementsr Zrequirements_to_checkr! �logger�warning�join�map�repr�sorted)r r r r# r$ r r r r J s* �����z)SourceDistribution._prepare_build_backend� Iterable[str]c C � | j j�7 td�}| j j}|d usJ �|�|�� |�� W d � W d � S 1 s.w Y W d � d S 1 s>w Y d S )Nz#Getting requirements to build wheel)r r r �pep517_backend�subprocess_runnerZget_requires_for_build_wheel�r ZrunnerZbackendr r r �_get_build_requires_wheelf s ��"�z,SourceDistribution._get_build_requires_wheelc C r0 )Nz&Getting requirements to build editable)r r r r1 r2 Zget_requires_for_build_editabler3 r r r �_get_build_requires_editablen s ���"�z/SourceDistribution._get_build_requires_editablec C sh | j jr| j jr| j jr| �� }n| �� }| j j�|�\}}|r&| �d|� | j jj |dd| j d� d S )Nr Znormalzbackend dependenciesr&