U ��.ee�@sVddlZddlmZddlmZddlmZddlmZe� e �Z Gdd�de�Z dS)�N)�BuildEnvironment)�AbstractDistribution)�InstallationError)�runner_with_spinner_messagec@s(eZdZdZdd�Zdd�Zdd�ZdS) �SourceDistributiona�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`. NOTE from @pradyunsg (14 June 2019) I expect SourceDistribution class will need to be split into `legacy_source` (setup.py based) and `source` (PEP 517 based) when we start bringing logic for preparation out of InstallRequirement into this class. cCs |j��S�N)�reqZget_dist)�self�r �M/usr/lib/python3.8/site-packages/pip/_internal/distributions/source/legacy.py�get_pkg_resources_distributionsz1SourceDistribution.get_pkg_resources_distributioncCs<|j��|jjo|}|r$|�|�|j��|j��dSr)rZload_pyproject_tomlZ use_pep517�_setup_isolationZprepare_metadataZassert_source_matches_version)r �finderZbuild_isolationZshould_isolater r r �prepare_distribution_metadatas     z0SourceDistribution.prepare_distribution_metadatac s���fdd�}t��j_�jj�|�jjdd��jj��jj�\�}�rT|d��|r�t�d�j�t�dd� t t t |�����jj�4t d �}�jj}|�|��|��}W5QRXW5QRX�jj�|�\�}�r�|d ���jj�||d d �dS) Ncs6d}|j�j|d�dd�t��D��d�}t|��dS)NzZSome build dependencies for {requirement} conflict with {conflicting_with}: {description}.z, css|]\}}d||fVqdS)z%s is incompatible with %sNr )�.0Z installedZwantedr r r � 3s�zPSourceDistribution._setup_isolation.._raise_conflicts..)Z requirement�conflicting_with� description)�formatr�join�sortedr)rZconflicting_reqs� format_stringZ error_message�Z conflictingr r r �_raise_conflicts+s� ��z=SourceDistribution._setup_isolation.._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)rrZ build_envZinstall_requirementsZpyproject_requiresZcheck_requirementsZrequirements_to_check�loggerZwarningr�map�reprrrZpep517_backendZsubprocess_runnerZget_requires_for_build_wheel)r rrZmissingZrunnerZbackendZreqsr rr r *sP ����� �  �z#SourceDistribution._setup_isolationN)�__name__� __module__� __qualname__�__doc__r rr r r r r rs  r) ZloggingZpip._internal.build_envrZ pip._internal.distributions.baserZpip._internal.exceptionsrZpip._internal.utils.subprocessrZ getLoggerrrrr r r r �s