o 7]h@sdZddlZddlZddlmZddlmZmZmZddl m Z ddl m Z m Z ddlmZddlmZdd lmZdd lmZdd lmZeeZd eed eededdfddZdeedeed eedeedeededededededede dededefddZdS) z6Legacy installation process, i.e. `setup.py install`. N) change_root)ListOptionalSequence)BuildEnvironment)InstallationErrorLegacyInstallFailure)Scheme) ensure_dir)make_setuptools_install_args)runner_with_spinner_message) TempDirectory record_linesrootreq_descriptionreturnc sdtdtffdd }|D]}tj|}|dr ||}n q d|}t|g}|D]}|} tj| r@| tjj 7} | tj || |q.| t |tj|d} t| d} | d |d WddS1swwYdS) Npathrcs"dus tj|s |St|S)N)osrisabsr)rrI/usr/lib/python3/dist-packages/pip/_internal/operations/install/legacy.py prepend_roots zBwrite_installed_files_from_setuptools_record..prepend_rootz .egg-infoz{} did not indicate that it installed an .egg-info directory. Only setup.py projects generating .egg-info directories are supported.zinstalled-files.txtw )strrrdirnameendswithformatrstripisdirsepappendrelpathsortr joinopenwrite) rrrrline directory egg_info_dirmessage new_linesfilenameinst_files_pathfrrr,write_installed_files_from_setuptools_records.     "r0install_optionsglobal_optionshomeprefix use_user_site pycompilescheme setup_py_pathisolatedreq_name build_envunpacked_source_directorycCs4|j}tdd}zMtj|jd}t|||||||||| |d }td| }| ||| dWdn1s;wYtj|sUt d|WWddSWnt yh}zt | d |d}~wwt |}| }Wdn1s~wYWdn1swYt||| d S) Nrecord)kindzinstall-record.txt) r2r1record_filenamerr4 header_dirr3r5no_user_configr6zRunning setup.py install for )cmdcwdzRecord file %s not foundF)package_detailsT)headersr rrr%r r existsloggerdebug Exceptionrr&read splitlinesr0)r1r2rr3r4r5r6r7r8r9r:r;r<rr@temp_dirr? install_argsrunnerer/rrrrinstall9sT      +rP)__doc__loggingrdistutils.utilrtypingrrrpip._internal.build_envrpip._internal.exceptionsrrpip._internal.models.schemer pip._internal.utils.miscr $pip._internal.utils.setuptools_buildr pip._internal.utils.subprocessr pip._internal.utils.temp_dirr getLogger__name__rGrr0boolrPrrrrsj         %