ôYKã@s§ddlmZddlZddlZddlZddlZddljjZ ddl Z e jZ Gdd„de jƒZdd„e jj Dƒej e_ dS)é)ÚDistutilsArgErrorNc@sÀeZdZdZejjddgZejjddgZddd „fd d d „fgZe eƒZ d d „Z dd„Z dd„Z dd„Zedd„ƒZdd„ZdS)Úinstallz7Use easy_install to install the package, w/dependenciesúold-and-unmanageableNúTry not to use this!ú!single-version-externally-managedú5used by system package builders to create 'flat' eggsÚinstall_egg_infocCsdS)NT©)Úselfr r ú@/tmp/pip-build-3puug3g5/setuptools/setuptools/command/install.pyÚszinstall.Úinstall_scriptscCsdS)NTr )r r r r r scCs&tjj|ƒd|_d|_dS)N)ÚorigrÚinitialize_optionsÚold_and_unmanageableÚ!single_version_externally_managed)r r r r r s zinstall.initialize_optionscCsRtjj|ƒ|jr%d|_n)|jrN|j rN|j rNtdƒ‚dS)NTzAYou must specify --record or --root when building system packages)rrÚfinalize_optionsÚrootrÚrecordr)r r r r r%s   zinstall.finalize_optionscCs8|js|jr"tjj|ƒSd|_d|_dS)NÚ)rrrrÚhandle_extra_pathÚ path_fileÚ extra_dirs)r r r r r0s zinstall.handle_extra_pathcCsX|js|jr"tjj|ƒS|jtjƒƒsJtjj|ƒn |jƒdS)N) rrrrÚrunÚ_called_from_setupÚinspectÚ currentframeÚdo_egg_install)r r r r r:s z install.runcCs«|dkrHd}tj|ƒtjƒdkrDd}tj|ƒdStj|ƒd}|dd…\}tj|ƒ}|jjdd ƒ}|d koª|j d kS) añ Attempt to detect whether run() was called from setup() or by another command. If called by setup(), the parent caller will be the 'run_command' method in 'distutils.dist', and *its* caller will be the 'run_commands' method. If called any other way, the immediate caller *might* be 'run_command', but it won't have been called by 'run_commands'. Return True in that case or if a call stack is unavailable. Return False otherwise. Nz4Call stack not available. bdist_* commands may fail.Ú IronPythonz6For best results, pass -X:Frames to enable call stack.TééÚ__name__rzdistutils.distÚ run_commands) ÚwarningsÚwarnÚplatformÚpython_implementationrZgetouterframesZ getframeinfoÚ f_globalsÚgetÚfunction)Z run_frameÚmsgÚresZcallerÚinfoZ caller_moduler r r rEs    zinstall._called_from_setupcCsÆ|jjdƒ}||jddd|jd|jƒ}|jƒd|_|jjtjdƒƒ|j dƒ|jj dƒj g}t j r¦|jd t j ƒ||_|jƒdt _ dS) NÚ easy_installÚargsÚxrrÚ.z*.eggZ bdist_eggr)Ú distributionÚget_command_classrrÚensure_finalizedZalways_copy_fromZ package_indexÚscanÚglobÚ run_commandÚget_command_objZ egg_outputÚ setuptoolsZbootstrap_install_fromÚinsertr.r)r r-Úcmdr.r r r r`s$      zinstall.do_egg_install)rNr)rNr)r!Ú __module__Ú __qualname__Ú__doc__rrÚ user_optionsÚboolean_optionsÚ new_commandsÚdictÚ_ncrrrrÚ staticmethodrrr r r r rs        rcCs)g|]}|dtjkr|‘qS)r)rrB)Ú.0r:r r r ú {s rE)Údistutils.errorsrrr5r#r%Údistutils.command.installÚcommandrrr8Ú_installÚ sub_commandsr@r r r r Ús      l