zmc
2023-08-08 e792e9a60d958b93aef96050644f369feb25d61b
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
U
H=®d™ã@sždZddlZddlZddlmZddlZddlmZddlZddl    m
Z
ddl m Z ddl mZmZe e¡Zd    d
„ZGd d „d eƒZdd d„Zddd„ZdS)zIBuild wheels/sdists by installing build deps to a temporary environment.
éN)Útoml)Ú
check_call)Ú    get_paths)Úmkdtempé)ÚPep517HookCallerÚ LoggerWrapperc    CsHttj |d¡ƒ}t |¡}W5QRX|d}|d|d| d¡fS)Nzpyproject.tomlz build-systemÚrequiresz build-backendz backend-path)ÚopenÚosÚpathÚjoinrÚloadÚget)Ú
source_dirÚfZpyproject_dataZbuildsys©rúRD:\z\workplace\VsCode\pyvenv\venv\Lib\site-packages\pip/_vendor/pep517/envbuild.pyÚ_load_pyprojectsýrc@s6eZdZdZdZd dd„Zdd„Zdd    „Zd
d „ZdS) ÚBuildEnvironmentz‡Context manager to install build deps in a simple temporary environment
 
    Based on code I wrote for pip, which is MIT licensed.
    NTcCs
||_dS)N)Ú_cleanup)ÚselfÚcleanuprrrÚ__init__9szBuildEnvironment.__init__cCsútdd|_t d|j¡tj dd¡|_tj dd¡|_tj    dkrHdnd}t
||j|jdœd    }|d
}|jrˆ|tj |jtjd<n|tj tj tjd<|d |d kr¸|d }n|d tj |d }|jrì|tj |jtjd<n
|tjd<|S) Nzpep517-build-env-)ÚprefixzTemporary build environment: %sÚPATHÚ
PYTHONPATHÚntÚ posix_prefix)ÚbaseÚplatbase)ÚvarsÚscriptsÚpurelibÚplatlib) rr ÚlogÚinfor ÚenvironrÚ    save_pathÚsave_pythonpathÚnamerÚpathsepÚdefpath)rZinstall_schemeZ install_dirsr"Úlib_dirsrrrÚ    __enter__<s0 þ
 
 ÿÿ 
zBuildEnvironment.__enter__cCsT|sdSt d|¡tjddddd|jgt|ƒ}t|tttj    ƒtttj
ƒddS)    zAInstall dependencies into this env by calling pip in a subprocessNzCalling pip to install %sz-mÚpipÚinstallz--ignore-installedz--prefix)ÚstdoutÚstderr) r%r&ÚsysÚ
executabler ÚlistrrÚloggingÚINFOÚERROR)rÚreqsÚcmdrrrÚ pip_install\s$ þþ
 
ýzBuildEnvironment.pip_installcCs~|jo|jdk    otj |j¡}|r.t |j¡|jdkrHtj dd¡n |jtjd<|j    dkrntj dd¡n |j    tjd<dS)Nrr)
rr r ÚisdirÚshutilÚrmtreer(r'Úpopr))rÚexc_typeÚexc_valÚexc_tbZ needs_cleanuprrrÚ__exit__jsÿ ý 
 
zBuildEnvironment.__exit__)T)    Ú__name__Ú
__module__Ú __qualname__Ú__doc__r rr.r;rCrrrrrs 
 rc    
Csn|dkr i}t|ƒ\}}}t|||ƒ}tƒ8}| |¡| |¡}| |¡| ||¡W5QR£SQRXdS)amBuild a wheel from a source directory using PEP 517 hooks.
 
    :param str source_dir: Source directory containing pyproject.toml
    :param str wheel_dir: Target directory to create wheel in
    :param dict config_settings: Options to pass to build backend
 
    This is a blocking function which will run pip in a subprocess to install
    build requirements.
    N)rrrr;Úget_requires_for_build_wheelÚ build_wheel)    rÚ    wheel_dirÚconfig_settingsr    ÚbackendÚ backend_pathÚhooksÚenvr9rrrrI~s
 
 
 
rIc    
Csn|dkr i}t|ƒ\}}}t|||ƒ}tƒ8}| |¡| |¡}| |¡| ||¡W5QR£SQRXdS)amBuild an sdist from a source directory using PEP 517 hooks.
 
    :param str source_dir: Source directory containing pyproject.toml
    :param str sdist_dir: Target directory to place sdist in
    :param dict config_settings: Options to pass to build backend
 
    This is a blocking function which will run pip in a subprocess to install
    build requirements.
    N)rrrr;Úget_requires_for_build_sdistÚ build_sdist)    rZ    sdist_dirrKr    rLrMrNrOr9rrrrQ”s
 
 
 
rQ)N)N)rGr r6Ú pip._vendorrr=Ú
subprocessrr3Ú    sysconfigrÚtempfilerÚwrappersrrÚ    getLoggerrDr%rÚobjectrrIrQrrrrÚ<module>s    
 a