a Ra@sddlZddlmZmZmZddlmZddlmZddl m Z ddl m Z ddl mZddlmZeeZGd d d eZdS) N)IterableSetTuple)BuildEnvironment)AbstractDistribution)InstallationError) PackageFinder)BaseDistribution)runner_with_spinner_messagec@seZdZdZedddZeeddddZedd d d Z e e dd d Z e e dddZ edd ddZe eee e fddddZdS)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`. )returncCsddlm}||jS)Nr) Distribution)Z$pip._internal.metadata.pkg_resourcesr reqZget_dist)selfZ_DistrR/opt/alt/python39/lib/python3.9/site-packages/pip/_internal/distributions/sdist.pyget_metadata_distributions z,SourceDistribution.get_metadata_distributionN)finderbuild_isolationr cCsF|j|jjo|}|r8|||j|||jdS)N)rZload_pyproject_tomlZ use_pep517_prepare_build_backendZisolated_editable_sanity_check_install_build_reqsZprepare_metadata)rrrZshould_isolaterrrprepare_distribution_metadatas     z0SourceDistribution.prepare_distribution_metadata)rr c Cs~|jj}t|j_|jj||dd|jj|jj\}}|rL|d||rzt d|jt dd t t t |dS)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 )rpyproject_requiresr build_envinstall_requirementscheck_requirementsZrequirements_to_check_raise_conflictsloggerZwarningjoinmapreprsorted)rrr conflictingmissingrrrr3s&  z)SourceDistribution._prepare_build_backendc Cs||jj`td}|jj}||&|WdWdS1sP0YWdn1sn0YdS)Nz#Getting requirements to build wheel)rrr pep517_backendsubprocess_runnerZget_requires_for_build_wheelrZrunnerZbackendrrr_get_build_requires_wheelMs   z,SourceDistribution._get_build_requires_wheelc Cs||jj`td}|jj}||&|WdWdS1sP0YWdn1sn0YdS)Nz&Getting requirements to build editable)rrr r$r%Zget_requires_for_build_editabler&rrr_get_build_requires_editableUs  z/SourceDistribution._get_build_requires_editablecCsf|jjr$|jjr$|jr$|}n|}|jj|\}}|rN|d||jj ||dddS)Nzthe backend dependenciesZnormalzInstalling backend dependencies) rZeditableZpermit_editable_wheelsZsupports_pyproject_editabler(r'rrrr)rrZ build_reqsr"r#rrrr_s  z&SourceDistribution._install_build_reqs)conflicting_withconflicting_reqsr cCs6d}|j|j|dddt|Dd}t|dS)NzZSome build dependencies for {requirement} conflict with {conflicting_with}: {description}.z, css |]\}}|d|VqdS)z is incompatible with Nr).0Z installedZwantedrrr |sz6SourceDistribution._raise_conflicts..)Z requirementr) description)formatrrr!r)rr)r* format_stringZ error_messagerrrrrs z#SourceDistribution._raise_conflicts)__name__ __module__ __qualname____doc__r rrboolrrrstrr'r(rrrrrrrrr s  r )ZloggingtypingrrrZpip._internal.build_envrZ pip._internal.distributions.baserZpip._internal.exceptionsrZ"pip._internal.index.package_finderrZpip._internal.metadatar Zpip._internal.utils.subprocessr Z getLoggerr0rr rrrrs