o _a*@s|ddlmZddlZddlZddlZddlZddlmmZ ddl Z e jZ Gddde jZdde jj Dej e_ dS))DistutilsArgErrorNc@seZdZdZejjddgZejjddgZdddfd d dfgZe eZ d d Z d dZ ddZ ddZeddZddZdS)installz7Use easy_install to install the package, w/dependencies)old-and-unmanageableNzTry not to use this!)!single-version-externally-managedNz5used by system package builders to create 'flat' eggsrrinstall_egg_infocCdSNTselfr r zinstall.install_scriptscCrrr r r r r r rcCs*tdtjtj|d|_d|_dS)NzRsetup.py install is deprecated. Use build and pip and other standards-based tools.) warningswarn setuptoolsSetuptoolsDeprecationWarningorigrinitialize_optionsold_and_unmanageable!single_version_externally_managedr r r r r s  zinstall.initialize_optionscCsBtj||jrd|_dS|jr|js|jstddSdSdS)NTzAYou must specify --record or --root when building system packages)rrfinalize_optionsrootrrecordrr r r r r,s   zinstall.finalize_optionscCs(|js|jr tj|Sd|_d|_dS)N)rrrrhandle_extra_path path_file extra_dirsr r r r r7s   zinstall.handle_extra_pathcCsB|js|jr tj|S|tstj|dS|dS)N) rrrrrun_called_from_setupinspect currentframedo_egg_installr r r r rAs   z install.runcCsz|durd}t|tdkrd}t|dSt|d}|dd\}t|}|jdd }|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) rrplatformpython_implementationr!getouterframes getframeinfo f_globalsgetfunction) run_framemsgrescallerinfo caller_moduler r r r Ls     zinstall._called_from_setupcCs|jd}||jd|j|jd}|d|_|jtd| d|j dj g}t j r8|dt j ||_|jdd dt _ dS) N easy_installx)argsrr.z*.egg bdist_eggrF)show_deprecation) distributionget_command_classrrensure_finalizedalways_copy_from package_indexscanglob run_commandget_command_obj egg_outputrbootstrap_install_frominsertr8r)r r6cmdr8r r r r#gs    zinstall.do_egg_installN)r' __module__ __qualname____doc__rr user_optionsboolean_options new_commandsdict_ncrrrr staticmethodr r#r r r r rs(       rcCsg|] }|dtjvr|qS)r)rrP).0rHr r r srS)distutils.errorsrr!rBrr)distutils.command.installcommandrrr_install sub_commandsrNr r r r s s