ó þ¾v]c@svdZddlZddlZddlZddlZddlZddlZddlZddlZddl m Z ddl m Z ddl mZdddd d d d gZd efd „ƒYZdejjfd„ƒYZd„Zd„Zd„Zd„Zdefd„ƒYZdefd„ƒYZeƒZejZejZejZejZej Z eƒZ!dS(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ÿÿÿÿN(tTemporaryDirectory(tparse_requirements(tmakedirstget_requires_for_build_sdisttget_requires_for_build_wheelt prepare_metadata_for_build_wheelt build_wheelt build_sdistt __legacy__tSetupRequirementsErrorcBseZd„ZRS(cCs ||_dS(N(t specifiers(tselfR ((s;/tmp/pip-install-vZZv26/setuptools/setuptools/build_meta.pyt__init__4s(t__name__t __module__R (((s;/tmp/pip-install-vZZv26/setuptools/setuptools/build_meta.pyR 3st DistributioncBs)eZd„Zeejd„ƒƒZRS(cCs+tttt|ƒƒƒ}t|ƒ‚dS(N(tlisttmaptstrRR (R R tspecifier_list((s;/tmp/pip-install-vZZv26/setuptools/setuptools/build_meta.pytfetch_build_eggs9sccs5tjj}|tj_z dVWd|tj_XdS(sw Replace distutils.dist.Distribution with this class for the duration of this context. N(t distutilstcoreR(tclstorig((s;/tmp/pip-install-vZZv26/setuptools/setuptools/build_meta.pytpatch>s    (R RRt classmethodt contextlibtcontextmanagerR(((s;/tmp/pip-install-vZZv26/setuptools/setuptools/build_meta.pyR8s cCs:tjddkr6t|tƒ r6|jtjƒƒS|S(s‘ Convert a filename to a string (on Python 2, explicitly a byte string, not Unicode) as distutils checks for the exact type str. ii(tsyst version_infot isinstanceRtencodetgetfilesystemencoding(ts((s;/tmp/pip-install-vZZv26/setuptools/setuptools/build_meta.pyt_to_strNs#cCsAgtj|ƒD]-}tjjtjj||ƒƒr|^qS(N(tostlistdirtpathtisdirtjoin(ta_dirtname((s;/tmp/pip-install-vZZv26/setuptools/setuptools/build_meta.pyt_get_immediate_subdirectories[scs,‡fd†tj|ƒDƒ}|\}|S(Nc3s$|]}|jˆƒr|VqdS(N(tendswith(t.0tf(t extension(s;/tmp/pip-install-vZZv26/setuptools/setuptools/build_meta.pys bs(R$R%(t directoryR/tmatchingtfile((R/s;/tmp/pip-install-vZZv26/setuptools/setuptools/build_meta.pyt_file_with_extension`s cCs5tjj|ƒstjdƒSttdtƒ|ƒS(Nu%from setuptools import setup; setup()topen(R$R&texiststiotStringIOtgetattrttokenizeR4(t setup_script((s;/tmp/pip-install-vZZv26/setuptools/setuptools/build_meta.pyt_open_setup_scriptis t_BuildMetaBackendcBsneZd„Zd„Zdd„Zd d„Zd d„Zd d„Zd„Z d d d„Z d d „Z RS( cCs |p i}|jdgƒ|S(Ns--global-option(t setdefault(R tconfig_settings((s;/tmp/pip-install-vZZv26/setuptools/setuptools/build_meta.pyt _fix_configss cCsv|j|ƒ}tjd dg|dt_y!tjƒ|jƒWdQXWn tk rq}||j7}nX|S(Nitegg_infos--global-option(R?RtargvRRt run_setupR R (R R>t requirementste((s;/tmp/pip-install-vZZv26/setuptools/setuptools/build_meta.pyt_get_build_requiresxs ssetup.pycBsT|}d}e|ƒ}|jƒjddƒ}WdQXe||dƒeƒUdS(Nt__main__s\r\ns\ntexec(R;treadtreplacetcompiletlocals(R R:t__file__R R.tcode((s;/tmp/pip-install-vZZv26/setuptools/setuptools/build_meta.pyRB…s cCs%|j|ƒ}|j|ddgƒS(NRCtwheel(R?RE(R R>((s;/tmp/pip-install-vZZv26/setuptools/setuptools/build_meta.pyRscCs"|j|ƒ}|j|dgƒS(NRC(R?RE(R R>((s;/tmp/pip-install-vZZv26/setuptools/setuptools/build_meta.pyR”scCs)tjd ddt|ƒgt_|jƒ|}x¦trÛgtj|ƒD]}|jdƒrL|^qL}t|ƒdkr¿tt |ƒƒdkr¿tj j |tj|ƒdƒ}q6nt|ƒdks×t ‚Pq6W||kr!t jtj j ||dƒ|ƒt j|dtƒn|dS(Nit dist_infos --egg-bases .dist-infoit ignore_errors(RRAR#RBtTrueR$R%R,tlenR+R&R(tAssertionErrortshutiltmovetrmtree(R tmetadata_directoryR>tdist_info_directoryR.t dist_infos((s;/tmp/pip-install-vZZv26/setuptools/setuptools/build_meta.pyR˜s(    cCsâ|j|ƒ}tjj|ƒ}t|dtƒtd|ƒœ}tjd |d|g|dt_|j ƒt ||ƒ}tjj ||ƒ}tjj |ƒr¹tj |ƒntjtjj ||ƒ|ƒWdQX|S(Ntexist_oktdiris --dist-dirs--global-option(R?R$R&tabspathRRQRRRARBR3R(R5tremovetrename(R t setup_commandtresult_extensiontresult_directoryR>t tmp_dist_dirtresult_basenamet result_path((s;/tmp/pip-install-vZZv26/setuptools/setuptools/build_meta.pyt_build_with_temp_dir·s %cCs|jdgd||ƒS(Nt bdist_wheels.whl(Re(R twheel_directoryR>RW((s;/tmp/pip-install-vZZv26/setuptools/setuptools/build_meta.pyRÎscCs|jdddgd||ƒS(Ntsdists --formatstgztars.tar.gz(Re(R tsdist_directoryR>((s;/tmp/pip-install-vZZv26/setuptools/setuptools/build_meta.pyRÓsN( R RR?RERBtNoneRRRReRR(((s;/tmp/pip-install-vZZv26/setuptools/setuptools/build_meta.pyR<qs      t_BuildMetaLegacyBackendcBseZdZdd„ZRS(sCCompatibility backend for setuptools This is a version of setuptools.build_meta that endeavors to maintain backwards compatibility with pre-PEP 517 modes of invocation. It exists as a temporary bridge between the old packaging mechanism and the new packaging mechanism, and will eventually be removed. ssetup.pycCsttjƒ}tjjtjj|ƒƒ}|tjkrRtjjd|ƒnztt|ƒj d|ƒWd|tj(XdS(NiR:( RRR&R$tdirnameR\tinserttsuperRlRB(R R:tsys_patht script_dir((s;/tmp/pip-install-vZZv26/setuptools/setuptools/build_meta.pyRBás(R Rt__doc__RB(((s;/tmp/pip-install-vZZv26/setuptools/setuptools/build_meta.pyRlÙs("RrR6R$RR9RTRt setuptoolsRtsetuptools.py31compatRt pkg_resourcesRtpkg_resources.py31compatRt__all__t BaseExceptionR tdistRR#R+R3R;tobjectR<Rlt_BACKENDRRRRRR(((s;/tmp/pip-install-vZZv26/setuptools/setuptools/build_meta.pytsB           h