U jau@s~ddlZddlmZmZddlmZddlmZddlm Z ddl m Z ddl m Z ddlmZeeZGd d d e ZdS) N)SetTuple) Distribution)BuildEnvironment)AbstractDistribution)InstallationError) PackageFinder)runner_with_spinner_messagec@s@eZdZdZedddZeeddddZedd d d Z dS) 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`. )returncCs |jSN)reqget_dist)selfry/private/var/folders/k6/_7fsz4ts3b78x3b3xwrxjh_c8s8xv7/T/pip-unpacked-wheel-bug3gbve/pip/_internal/distributions/sdist.pyget_pkg_resources_distributionsz1SourceDistribution.get_pkg_resources_distributionN)finderbuild_isolationr cCs2|j|jjo|}|r$|||jdSr )r load_pyproject_toml use_pep517_setup_isolationprepare_metadata)rrrshould_isolaterrrprepare_distribution_metadatas    z0SourceDistribution.prepare_distribution_metadata)rr c s0tttttfddfdd }jj}|dk s8ttj_jj||ddjj jj \}rz|d|rt djt dd ttt|jj@td }jj}|dk st|||}W5QRXW5QRXjj |\}r|d jj||d d dS)N)conflicting_withconflicting_reqsr cs6d}|jj|dddtDd}t|dS)NzZSome build dependencies for {requirement} conflict with {conflicting_with}: {description}.z, css |]\}}|d|VqdS)z is incompatible with Nr).0 installedwantedrrr 1szPSourceDistribution._setup_isolation.._raise_conflicts..) requirementr description)formatr joinsortedr)rr format_string error_message conflictingrrr_raise_conflicts's z=SourceDistribution._setup_isolation.._raise_conflictsoverlayzInstalling 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 dependenciesnormalzInstalling backend dependencies)strrrr pyproject_requiresAssertionErrorr build_envinstall_requirementscheck_requirementsrequirements_to_checkloggerwarningr$mapreprr%r pep517_backendsubprocess_runnerget_requires_for_build_wheel)rrr*r.missingrunnerbackendreqsrr(rr&sT       z#SourceDistribution._setup_isolation) __name__ __module__ __qualname____doc__rrrboolrrrrrrr s r )loggingtypingrrZpip._vendor.pkg_resourcesrpip._internal.build_envr pip._internal.distributions.baserpip._internal.exceptionsr"pip._internal.index.package_finderrpip._internal.utils.subprocessr getLoggerr?r4r rrrrs