ó Àfc@södZddlZddlZddlZddlZddlZddlZddlZdefd„ƒYZ dej j fd„ƒYZ dd„Z d „Z d „Zd „Zdd „Zdd „Zdd„Zddd„Zdd„ZdS(s-A PEP 517 interface to setuptools Previously, when a user or a command line tool (let's call it a "frontend") needed to make a request of setuptools to take a certain action, for example, generating a list of installation requirements, the frontend would would call "setup.py egg_info" or "setup.py bdist_wheel" on the command line. PEP 517 defines a different method of interfacing with setuptools. Rather than calling "setup.py" directly, the frontend should: 1. Set the current directory to the directory with a setup.py file 2. Import this module into a safe python interpreter (one in which setuptools can potentially set global variables or crash hard). 3. Call one of the functions defined in PEP 517. What each function does is defined in PEP 517. However, here is a "casual" definition of the functions (this definition should not be relied on for bug reports or API stability): - `build_wheel`: build a wheel in the folder and return the basename - `get_requires_for_build_wheel`: get the `setup_requires` to build - `prepare_metadata_for_build_wheel`: get the `install_requires` - `build_sdist`: build an sdist in the folder and return the basename - `get_requires_for_build_sdist`: get the `setup_requires` to build Again, this is not a formal definition! Just a "taste" of the module. iÿÿÿÿNtSetupRequirementsErrorcBseZd„ZRS(cCs ||_dS(N(t specifiers(tselfR((s9/usr/lib/python2.7/site-packages/setuptools/build_meta.pyt__init__(s(t__name__t __module__R(((s9/usr/lib/python2.7/site-packages/setuptools/build_meta.pyR'st DistributioncBs)eZd„Zeejd„ƒƒZRS(cCst|ƒ‚dS(N(R(RR((s9/usr/lib/python2.7/site-packages/setuptools/build_meta.pytfetch_build_eggs-sccs5tjj}|tj_z dVWd|tj_XdS(sw Replace distutils.dist.Distribution with this class for the duration of this context. N(t distutilstcoreR(tclstorig((s9/usr/lib/python2.7/site-packages/setuptools/build_meta.pytpatch0s    (RRRt classmethodt contextlibtcontextmanagerR (((s9/usr/lib/python2.7/site-packages/setuptools/build_meta.pyR,s ssetup.pycBsa|}d}eedeƒ|ƒ}|jƒjddƒ}|jƒe||dƒeƒUdS(Nt__main__topens\r\ns\ntexec(tgetattrttokenizeRtreadtreplacetclosetcompiletlocals(t setup_scriptt__file__Rtftcode((s9/usr/lib/python2.7/site-packages/setuptools/build_meta.pyt _run_setup@s  cCs |p i}|jdgƒ|S(Ns--global-option(t setdefault(tconfig_settings((s9/usr/lib/python2.7/site-packages/setuptools/build_meta.pyt _fix_configKs cCs|t|ƒ}ddg}tjd dg|dt_ytjƒ tƒWdQXWn tk rw}||j7}nX|S(Nt setuptoolstwheelitegg_infos--global-option(R!tsystargvRR RRR(R t requirementste((s9/usr/lib/python2.7/site-packages/setuptools/build_meta.pyt_get_build_requiresQs   cCsAgtj|ƒD]-}tjjtjj||ƒƒr|^qS(N(tostlistdirtpathtisdirtjoin(ta_dirtname((s9/usr/lib/python2.7/site-packages/setuptools/build_meta.pyt_get_immediate_subdirectories`scCst|ƒ}t|ƒS(N(R!R)(R ((s9/usr/lib/python2.7/site-packages/setuptools/build_meta.pytget_requires_for_build_wheeles cCst|ƒ}t|ƒS(N(R!R)(R ((s9/usr/lib/python2.7/site-packages/setuptools/build_meta.pytget_requires_for_build_sdistjs cCstjd dd|gt_tƒ|}xŽtrºgtj|ƒD]}|jdƒrC|^qC}t|ƒdkr¶tt|ƒƒdkr¶tj j |tj|ƒdƒ}q-nPq-W||krt j tj j ||dƒ|ƒt j |dtƒn|dS(Nit dist_infos --egg-bases .dist-infoit ignore_errors(R%R&RtTrueR*R+tendswithtlenR1R,R.tshutiltmovetrmtree(tmetadata_directoryR tdist_info_directoryRt dist_infos((s9/usr/lib/python2.7/site-packages/setuptools/build_meta.pyt prepare_metadata_for_build_wheelos$   cCs©t|ƒ}tjj|ƒ}tjd dg|dt_tƒ|dkrptj|ƒtj d|ƒngtj |ƒD]}|j dƒr€|^q€}|dS(Nit bdist_wheels--global-optiontdists.whli( R!R*R,tabspathR%R&RR9R;tcopytreeR+R7(twheel_directoryR R<Rtwheels((s9/usr/lib/python2.7/site-packages/setuptools/build_meta.pyt build_wheelŒs   cCs©t|ƒ}tjj|ƒ}tjd dg|dt_tƒ|dkrptj|ƒtj d|ƒngtj |ƒD]}|j dƒr€|^q€}|dS(Nitsdists--global-optionRAs.tar.gzi( R!R*R,RBR%R&RR9R;RCR+R7(tsdist_directoryR Rtsdists((s9/usr/lib/python2.7/site-packages/setuptools/build_meta.pyt build_sdistžs   (t__doc__R*R%RR9RR"Rt BaseExceptionRRARRR!R)R1tNoneR2R3R?RFRJ(((s9/usr/lib/python2.7/site-packages/setuptools/build_meta.pyts&