a lj @ s d dl Z d dlmZmZmZ d dlmZ d dlmZ d dl m Z d dlmZ d dl mZ d dlmZ e eZG d d d eZdS ) N)IterableSetTuple)BuildEnvironment)AbstractDistribution)InstallationError) PackageFinder)BaseDistribution)runner_with_spinner_messagec @ s e Zd ZdZedddZeeddddZedd d dZ e e ddd Ze e dddZ edd ddZeeeeef ddddZdS )SourceDistributionzRepresents 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`. )returnc C s ddl m} || j S )Nr )Distribution)Z$pip._internal.metadata.pkg_resourcesr reqZget_dist)selfZ_Dist r E/usr/lib/python3.9/site-packages/pip/_internal/distributions/sdist.pyget_metadata_distribution s z,SourceDistribution.get_metadata_distributionN)finderbuild_isolationr c C sF | j | j jo|}|r8| | | j | | | j d S )N)r Zload_pyproject_tomlZ use_pep517_prepare_build_backendZisolated_editable_sanity_check_install_build_reqsZprepare_metadata)r r r Zshould_isolater r r prepare_distribution_metadata s z0SourceDistribution.prepare_distribution_metadata)r r c C s~ | j j}t | j _| j j||dd | j j| j j\}}|rL| d| |rzt d| j t dd ttt | d S )NZoverlayzInstalling 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 )r pyproject_requiresr build_envinstall_requirementscheck_requirementsZrequirements_to_check_raise_conflictsloggerZwarningjoinmapreprsorted)r r r conflictingmissingr r r r 3 s&