Re dZddlZddlZddlZddlZddlZddlmZddlm Z ddl m Z m Z ddl mZmZejeZdZd Zd Zd Zdd ZejZed deddddeddddeddddZedkreedSdS)z%Build a project using PEP 517 hooks. N)BuildEnvironment)Pep517HookCaller)tempdirmkdir_p)FileNotFoundError toml_loadcddh}|t|ks5d|t|z }t|dS)z7 Ensure build system has the requisite fields. requires build-backendz"Missing required fields: {missing})missingN)setformat ValueError)systemrequiredmessages /builddir/build/BUILDROOT/alt-python311-pip-21.3.1-3.el8.x86_64/opt/alt/python311/lib/python3.11/site-packages/pip/_vendor/pep517/build.pyvalidate_systemrs_O,H F # #6==S[[(>  !!! $ #ctj|d}tj|d5}t |}dddn #1swxYwY|dS)zC Load the build system from a source dir (pyproject.toml). zpyproject.tomlrbNz build-system)ospathjoinioopenr ) source_dir pyprojectfpyproject_datas r load_systemr"s Z)9::I D ! !&Q"1&&&&&&&&&&&&&&& . ))sAAAc t|}n#ttf$ri}YnwxYw|dd|dddg|S)z Given a source dir, attempt to get a build system backend and requirements from pyproject.toml. Fallback to setuptools but only if the file was not found or a build system was not indicated. r z setuptools.build_meta:__legacy__r setuptoolswheel)r"rKeyError setdefault)rrs r compat_systemr('sZ(( x ( * j<"9::: Ms ((c djdit}t||}|i}td|||tdt 5}td||djdit}t||} | |i} tj || } tj | tj |tj | ddddS#1swxYwYdS)Nzget_requires_for_build_{dist}zGot build requires: %sz$Installed dynamic build dependencieszTrying to build %s in %sz build_{dist}) rlocalsgetattrloginfo pip_installrrrrshutilmovebasename) hooksenvdistdestget_requires_name get_requiresreqstd build_namebuildfilenamesources r _do_buildr?:s>7>JJJJ5"344L <  DHH %t,,,OODHH 3444 Lb +T2666*^*66VXX66 z**5R==b(++ FBGLLrw/?/?/I/IJJKKK LLLLLLLLLLLLLLLLLLs CEE #E c|pt|}tj||pd}t |t |t ||d|d}t5}| |dt||||ddddS#1swxYwYdS)Nr5r z backend-pathr ) r"rrrrrrgetrr/r?)rr5r6rr3r4s rr<r<Ls  .{:..F 7<< DNF 3 3D DMMMF F?+VZZ-G-G  E   *s z*+++%dD)))******************s .CC  C rz%A directory containing pyproject.toml)helpz--binaryz-b store_trueF)actiondefaultz--sourcez-sz --out-dirz-oz>Destination in which to save the builds relative to source dirctdttd|js|jsdnd|js|jsdndf}|D]}t |j||jdS)NzQpep517.build is deprecated. Consider switching to https://pypi.org/project/build/sdistr%) r-warninglistfilterr>binaryr<rout_dir)argsdistsr5s rmainrOpsKKHIII ;;dk;t;;dk;t  E 33 dotT\222233r__main__)NN)__doc__argparserloggingrr0envbuildrwrappersrdirtoolsrrcompatrr getLogger__name__r-rr"r(r?r<ArgumentParserparser add_argumentrO parse_argsr*rrr^s  &&&&&&&&&&&&&&&&&&&&00000000g!! " " "***&LLL$ * * * * ! " " 0       I 3 3 3 zD    r