3 K]K@svddlmZddlZddlZddlZddlZddljjZ ddl Z e jZ Gddde jZdde jj Dej e_ dS))DistutilsArgErrorNc@seZdZdZejjddgZejjddgZddd fd d d fgZe eZ d d Z ddZ ddZ ddZeddZddZdS)installz7Use easy_install to install the package, w/dependenciesold-and-unmanageableNTry not to use this!!single-version-externally-managed5used by system package builders to create 'flat' eggsZinstall_egg_infocCsdS)NT)selfrr/usr/lib/python3.6/install.pyszinstall.Zinstall_scriptscCsdS)NTr)r rrr r scCstjj|d|_d|_dS)N)origrinitialize_optionsold_and_unmanageable!single_version_externally_managed)r rrr r s zinstall.initialize_optionscCs<tjj||jrd|_n|jr8|j r8|j r8tddS)NTzAYou must specify --record or --root when building system packages)r rfinalize_optionsrootrrecordr)r rrr r%s zinstall.finalize_optionscCs(|js |jrtjj|Sd|_d|_dS)N)rrr rhandle_extra_pathZ path_fileZ extra_dirs)r rrr r0s  zinstall.handle_extra_pathcCs@|js |jrtjj|S|jtjs4tjj|n|jdS)N) rrr rrun_called_from_setupinspectZ currentframedo_egg_install)r rrr r:s   z install.runcCsz|dkr4d}tj|tjdkr0d}tj|dStj|d}|dd\}tj|}|jjdd }|d kox|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.Z IronPythonz6For best results, pass -X:Frames to enable call stack.T__name__rzdistutils.distZ run_commands) warningswarnplatformZpython_implementationrZgetouterframesZ getframeinfo f_globalsgetZfunction)Z run_framemsgresZcallerinfoZ caller_modulerrr rEs     zinstall._called_from_setupcCs|jjd}||jd|j|jd}|jd|_|jjtjd|j d|jj dj g}t j rp|jdt j ||_|jdt _ dS)N easy_installx)argsrr.z*.eggZ bdist_eggr)Z distributionZget_command_classrrZensure_finalizedZalways_copy_fromZ package_indexscanglobZ run_commandZget_command_objZ egg_output setuptoolsZbootstrap_install_frominsertr&r)r r$cmdr&rrr r`s  zinstall.do_egg_install)rNr)rNr)r __module__ __qualname____doc__r rZ user_optionsZboolean_options new_commandsdict_ncr rrr staticmethodrrrrrr rs      rcCsg|]}|dtjkr|qS)r)rr2).0r,rrr {sr5)Zdistutils.errorsrrr)rrZdistutils.command.installZcommandrr r*_installZ sub_commandsr0rrrr s  l