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/lib/python3/dist-packages/pip/_internal/distributions/__pycache__/sdist.cpython-310.pyc
o

@%Ne{�@s�ddlZddlmZmZmZddlmZddlmZddl	m
Z
ddlmZddl
mZddlmZe�e�ZGd	d
�d
e�ZdS)�N)�Iterable�Set�Tuple)�BuildEnvironment)�AbstractDistribution)�InstallationError)�
PackageFinder)�BaseDistribution)�runner_with_spinner_messagec@s�eZdZdZdefdd�Zdededdfdd	�Zdeddfd
d�Z	de
efdd
�Zde
efdd�Z
deddfdd�Zdedeeeefddfdd�ZdS)�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`.
    �returncCs
|j��S�N)�req�get_dist)�self�r�C/usr/lib/python3/dist-packages/pip/_internal/distributions/sdist.py�get_metadata_distributions
z,SourceDistribution.get_metadata_distribution�finder�build_isolationNcCsF|j��|jjo
|}|r|�|�|j��|�|�|j��dSr
)r�load_pyproject_toml�
use_pep517�_prepare_build_backend�isolated_editable_sanity_check�_install_build_reqs�prepare_metadata)rrr�should_isolaterrr�prepare_distribution_metadatas



z0SourceDistribution.prepare_distribution_metadatac	Cs�|jj}|dus
J�t�|j_|jjj||ddd�|jj�|jj�\}}|r-|�d|�|rFt�	d|j�t�	dd�
ttt
|����dSdS)N�overlayzbuild dependencies��kindz"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�pyproject_requiresr�	build_env�install_requirements�check_requirements�requirements_to_check�_raise_conflicts�logger�warning�join�map�repr�sorted)rrr!�conflicting�missingrrrr1s*
�����z)SourceDistribution._prepare_build_backendc	C�|jj�7td�}|jj}|dusJ�|�|��|��Wd�Wd�S1s.wYWd�dS1s>wYdS)Nz#Getting requirements to build wheel)rr"r
�pep517_backend�subprocess_runner�get_requires_for_build_wheel�r�runner�backendrrr�_get_build_requires_wheelKs
��"�z,SourceDistribution._get_build_requires_wheelc	Cr/)Nz&Getting requirements to build editable)rr"r
r0r1�get_requires_for_build_editabler3rrr�_get_build_requires_editableSs
���"�z/SourceDistribution._get_build_requires_editablecCsh|jjr|jjr|j��r|��}n|��}|jj�|�\}}|r'|�d|�|jjj	||ddd�dS)Nzthe backend dependencies�normalzbackend dependenciesr)
r�editable�permit_editable_wheels�supports_pyproject_editabler8r6r"r$r&r#)rr�
build_reqsr-r.rrrr]s���

�z&SourceDistribution._install_build_reqs�conflicting_with�conflicting_reqscCs2d}|j|j|d�dd�t|�D��d�}t|��)NzZSome build dependencies for {requirement} conflict with {conflicting_with}: {description}.z, css"�|]\}}|�d|��VqdS)z is incompatible with Nr)�.0�	installed�wantedrrr�	<genexpr>zs
��
�z6SourceDistribution._raise_conflicts.<locals>.<genexpr>)�requirementr>�description)�formatrr)r,r)rr>r?�
format_string�
error_messagerrrr&ps�
��z#SourceDistribution._raise_conflicts)�__name__�
__module__�__qualname__�__doc__r	rr�boolrrr�strr6r8rrrr&rrrrrs*��
�
���r)�logging�typingrrr�pip._internal.build_envr� pip._internal.distributions.baser�pip._internal.exceptionsr�"pip._internal.index.package_finderr�pip._internal.metadatar	�pip._internal.utils.subprocessr
�	getLoggerrIr'rrrrr�<module>s