File: //usr/lib/python3.9/site-packages/pip/_internal/distributions/__pycache__/sdist.cpython-39.pyc
a
?�f� � @ s� d dl Z d dlmZ d dlmZ d dlmZ d dlmZ d dl m
Z
e
rpd dlmZm
Z
d dlmZ d d lmZ e �e�ZG d
d� de�ZdS )� N)�BuildEnvironment)�AbstractDistribution)�InstallationError)�runner_with_spinner_message)�MYPY_CHECK_RUNNING)�Set�Tuple)�Distribution)�
PackageFinderc @ s( e Zd ZdZdd� Zdd� Zdd� 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`.
c C s
| j �� S �N)�reqZget_dist)�self� r �E/usr/lib/python3.9/site-packages/pip/_internal/distributions/sdist.py�get_pkg_resources_distribution s z1SourceDistribution.get_pkg_resources_distributionc C s2 | j �� | j jo|}|r$| �|� | j �� d S r )r
Zload_pyproject_tomlZ
use_pep517�_setup_isolationZprepare_metadata)r �finderZbuild_isolationZshould_isolater r r �prepare_distribution_metadata s
z0SourceDistribution.prepare_distribution_metadatac sB � �fdd�}�j j}|d us"J �t� �j _�j j�||dd� �j j��j j�\� }� rd|d� � |r�t�d�j � t�dd� t
tt|���� �j j�^ t
d �}�j j}|d us�J �|�|�� |�� }W d � n1 s�0 Y W d � n1 s�0 Y �j j�|�\� }� �r*|d
� � �j j�||dd� d S )
Nc s6 d}|j �j| d�dd� t� �D ��d�}t|��d S )NzZSome build dependencies for {requirement} conflict with {conflicting_with}: {description}.z, c s s | ]\}}d � ||�V qdS )z{} is incompatible with {}N)�format)�.0Z installedZwantedr r r � <genexpr>5 s �zPSourceDistribution._setup_isolation.<locals>._raise_conflicts.<locals>.<genexpr>)Zrequirement�conflicting_with�description)r r
�join�sortedr )r Zconflicting_reqs�
format_stringZ
error_message�Zconflictingr r r �_raise_conflicts, s �
��z=SourceDistribution._setup_isolation.<locals>._raise_conflictsZoverlayzInstalling build dependenciesz"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 z#Getting requirements to build wheelzthe backend dependenciesZnormalzInstalling backend dependencies)r
�pyproject_requiresr Z build_envZinstall_requirementsZcheck_requirementsZrequirements_to_check�loggerZwarningr �map�reprr r Zpep517_backendZsubprocess_runnerZget_requires_for_build_wheel)r r r r ZmissingZrunnerZbackendZreqsr r r r * sN
�����
�D
�z#SourceDistribution._setup_isolationN)�__name__�
__module__�__qualname__�__doc__r r r r r r r r s r )ZloggingZpip._internal.build_envr Z pip._internal.distributions.baser Zpip._internal.exceptionsr Zpip._internal.utils.subprocessr Zpip._internal.utils.typingr �typingr r Zpip._vendor.pkg_resourcesr Z"pip._internal.index.package_finderr
Z getLoggerr# r r r r r r �<module> s