o ƚRe@sddlZddlmZmZmZddlmZddlmZddl m Z ddl m Z ddl mZddlmZeeZGd d d eZdS) N)IterableSetTuple)BuildEnvironment)AbstractDistribution)InstallationError) PackageFinder)BaseDistribution)runner_with_spinner_messagec@seZdZdZdefddZdededdfdd Zdeddfd d Z de e fd d Z de e fddZ deddfddZde deee e fddfddZdS)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)$pip._internal.metadata.pkg_resourcesr reqget_dist)self_Distr/builddir/build/BUILDROOT/alt-python310-pip-21.3.1-3.el8.x86_64/opt/alt/python310/lib/python3.10/site-packages/pip/_internal/distributions/sdist.pyget_metadata_distributions z,SourceDistribution.get_metadata_distributionfinderbuild_isolationNcCsF|j|jjo |}|r|||j|||jdS)N)rload_pyproject_toml use_pep517_prepare_build_backendisolated_editable_sanity_check_install_build_reqsprepare_metadata)rrrshould_isolaterrrprepare_distribution_metadatas     z0SourceDistribution.prepare_distribution_metadatac Cs|jj}|dus Jt|j_|jj||dd|jj|jj\}}|r,|d||rEt d|jt dd t t t |dSdS)NoverlayzInstalling 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_requirementsrequirements_to_check_raise_conflictsloggerwarningjoinmapreprsorted)rrr! conflictingmissingrrrr3s*   z)SourceDistribution._prepare_build_backendc C|jj7td}|jj}|dusJ|||WdWdS1s.wYWddS1s>wYdS)Nz#Getting requirements to build wheel)rr"r pep517_backendsubprocess_runnerget_requires_for_build_wheelrrunnerbackendrrr_get_build_requires_wheelMs   "z,SourceDistribution._get_build_requires_wheelc Cr/)Nz&Getting requirements to build editable)rr"r r0r1get_requires_for_build_editabler3rrr_get_build_requires_editableUs   "z/SourceDistribution._get_build_requires_editablecCsf|jjr|jjr|jr|}n|}|jj|\}}|r'|d||jj ||dddS)Nzthe backend dependenciesnormalzInstalling backend dependencies) reditablepermit_editable_wheelssupports_pyproject_editabler8r6r"r$r&r#)rr build_reqsr-r.rrrr_s  z&SourceDistribution._install_build_reqsconflicting_withconflicting_reqscCs2d}|j|j|dddt|Dd}t|)NzZSome build dependencies for {requirement} conflict with {conflicting_with}: {description}.z, css"|] \}}|d|VqdS)z is incompatible with Nr).0 installedwantedrrr |s  z6SourceDistribution._raise_conflicts..) requirementr> description)formatrr)r,r)rr>r? format_string error_messagerrrr&rs z#SourceDistribution._raise_conflicts)__name__ __module__ __qualname____doc__r rrboolrrrstrr6r8rrrr&rrrrr s*  r )loggingtypingrrrpip._internal.build_envr pip._internal.distributions.baserpip._internal.exceptionsr"pip._internal.index.package_finderrpip._internal.metadatar pip._internal.utils.subprocessr getLoggerrIr'r rrrrs