U 巀g @sddlZddlZddlZddlZddlmZmZddlmZddl m Z ddej j dej j dej j gZe rddhZd d eeeDZdeeeed d d ZedddZedddZdS)N)ListOptional)main)WINDOWSpip.z.execCsg|]}d|qS)r)join).0partsr M/opt/hc_python/lib/python3.8/site-packages/pip/_internal/utils/entrypoints.py sr)argsreturncCstjdt|S)aCentral wrapper for all old entrypoints. Historically pip has had several entrypoints defined. Because of issues arising from PATH, sys.path, multiple Pythons, their interactions, and most of them having a pip installed, users suffer every time an entrypoint gets moved. To alleviate this pain, and provide a mechanism for warning users and directing them to an appropriate place for help, we now define all of our old entrypoints as wrappers for the current one. aWARNING: pip is being invoked by an old script wrapper. This will fail in a future version of pip. Please see https://github.com/pypa/pip/issues/5599 for advice on fixing the underlying issue. To avoid this problem you can invoke Python with '-m pip' instead of running pip directly. )sysstderrwriter)rr r r _wrappers r)rcCstrdnd}tjtj|}tjtjdd tj }tj||k}|rt D]B}t |}tj||}|rRtj|rRtj||rR|SqRtdS)zHTry to figure out the best way to invoke pip in the current environment.ScriptsbinPATHrz -m pip)rospathr rprefixnormcaseenvirongetsplitpathsep_EXECUTABLE_NAMESshutilwhichexistssamefile#get_best_invocation_for_this_python)binary_directory binary_prefix path_partsexe_are_in_PATHexe_namefound_executablebinary_executabler r r get_best_invocation_for_this_pip.s&    r-cCs6tj}tj|}t|}|r2tj||r2|S|S)zs$