,ɑoldZddlmZddlZddlZddlZddlZddlZddlZddlm Z ddl m Z ddl m Z ddl mZddlmZdd lmZdd lmZmZdd lmZmZmZmZdd lmZmZmZmZm Z m!Z!dd l"m#Z#ddl$m%Z%m&Z&ddl'm(Z(m)Z)ddl*m+Z,ddl*m-Z-m.Z.ddl/m0Z0dgZ1ej2e3Z4GddeZ5dS)z(Base Command class, and related routines) annotationsN)Values)Callable) reconfigure) traceback) cmdoptions)CommandContextMixIn)ConfigOptionParserUpdatingDefaultsHelpFormatter)ERRORPREVIOUS_BUILD_DIR_ERROR UNKNOWN_ERRORVIRTUALENV_NOT_FOUND) BadCommand CommandErrorDiagnosticPipErrorInstallationErrorNetworkConnectionErrorPreviousBuildDirError)check_path_owner)BrokenStdoutLoggingError setup_logging)get_prognormalize_path)TempDirectoryTypeRegistry)global_tempdir_managertempdir_registry)running_under_virtualenvCommandceZdZUdZded<dZded<ddfd Zdd Zd dZd!dZ d"dZ d#dZ d$dZ d$dZ d%dZxZS)&rstrusageFboolignore_require_venvnamesummaryisolatedreturnNonec t||_||_t |jt d|td||j||_ d|_ |j d}tj |j ||_tjtj|j }|j ||dS)N F)r#prog formatteradd_help_optionr& descriptionr(z Options)super__init__r&r'r r#rr __doc__parserr capitalizeoptparse OptionGroupcmd_optsrmake_option_group general_groupadd_option_group add_options)selfr&r'r( optgroup_namegen_opts __class__s p/builddir/build/BUILD/cloudlinux-venv-1.0.10/venv/lib/python3.11/site-packages/pip/_internal/cli/base_command.pyr2zCommand.__init__2s   (*JJ''''355!     9= 9//11;;;  ,T[-HH /  $ K   $$X... cdSNr=s rAr<zCommand.add_optionsPs rBoptionsrc*t|drJdS)zf This is a no-op so that commands by default do not do the pip version check. no_indexN)hasattr)r=rGs rAhandle_pip_version_checkz Command.handle_pip_version_checkSs 7J///////rBargs list[str]intctrD)NotImplementedError)r=rGrLs rArunz Command.run\s!!rB level_numberc,dfd }jrtjd|S |}t|tsJ|S#t $rL}t d|ddit d d tcYd}~Sd}~wt$rT}t t|t d d tcYd}~Sd}~wttt f$rT}t t|t d d tcYd}~Sd}~wt"$rH}t d|t d d tcYd}~Sd}~wt$$rTt'd t(j |t,jkrt1jt(j tcYSt4$r@t d t d d tcYSt6$r&t dd t8cYSwxYw)Nr)rNc S#wxYwrD)rQrK)rLrGr=srA _inner_runz(Command._run_wrapper.._inner_run`sJ 7xx..--g6666--g6666s .AT) show_localsz%srich)extrazException information:)exc_infoz ERROR: Pipe to stdout was broken)filezOperation cancelled by userz Exception:)r)rN) debug_moderich_tracebackinstall isinstancerNrloggererrordebugr rcriticalr"r rrrrrprintsysstderrloggingDEBUGr print_excKeyboardInterrupt BaseExceptionr)r=rRrGrLrUstatusexcs` `` rA _run_wrapperzCommand._run_wrapper_s 7 7 7 7 7 7 7 7    "t 4 4 4 4:<< , !Z\\Ffc** * **M!    LLs64.L 9 9 9 LL1DL A A ALLLLLL$ , , , OOCHH % % % LL1DL A A A+ + + + + + +   "     OOCHH % % % LL1DL A A ALLLLLL    OOD# & & & LL1DL A A ALLLLLL'    43: F F F Fw},,#4444LLL     OO9 : : : LL1DL A A ALLL ! ! ! OOL4O 8 8 8  !sj"A J AB'!J' J4A D=JJA E,&J, J9=F<6J|t|_|t||\}}|j|jz |_|jrd|_t|dr|j dkr|jdkrdnd|_ t|j t|j|j |j }t|jtt jz}|r;t$d d t+||jrAd t.jvr3t$d t5jt8|jrd t.jd<|jr'd|jt.jd<|jrH|j sAtCs3t$dt5jtD|j#rTtI|j#|_#tK|j#s't$d|j#d|_#|&|||S)N progress_barautoronoff)no_color) verbosityr} user_log_filez/The following features are always enabled: %s. z, _PIP_RUNNING_IN_SUBPROCESSzAThe --python option must be placed before the pip subcommand name1 PIP_NO_INPUTr,PIP_EXISTS_ACTIONz2Could not find an activated virtualenv (required).zThe directory '%s' or its parent directory is not owned or is not writable by the current user. The cache has been disabled. Check the permissions and owner of that directory. If executing pip with sudo, you should use sudo's -H flag.)' enter_contextrrrpverbosequietr~r[rJryrr}rlogsetfeatures_enabledrALWAYS_ENABLED_FEATURESr_warningjoinsortedpythonosenvironrbrdexitr no_input exists_action require_venvr%rr cache_dirrrrm)r=rLrGrRalways_enabled_featuress rArtz Command._mains!% 2 23C3E3E F F 133444-- !7=8   DN 7N + + J0D0N0N+/>Q+>+>44EG W-....$n%!+   #&g&>"?"?#  .C C #  #  NNA &!899::    > :"*LL OOS    HUOOO   -),BJ~ &   N.1hhw7L.M.MBJ* +   /(@ /+-- / TUUU-...   ) .w/@ A AG #G$566 )* % %)!  w===rB.dict[str, Callable[[Values, list[str]], None]]ciS)zO map of names to handler actions for commands with sub-actions rErFs rA handler_mapzCommand.handler_maps  rB)F)r&r"r'r"r(r$r)r*)r)r*)rGrr)r*)rGrrLrMr)rN)rRrNrGrrLrMr)rN)rLrMr)rn)rLrMr)rN)r)r)__name__ __module__ __qualname__r#__annotations__r%r2r<rKrQrmrprvrtr __classcell__)r@s@rArr.s EOOOO %%%%%<    0000""""7!7!7!7!r,,,,K>K>K>K>ZrB)6r3 __future__rrflogging.configr6rrdrrtypingrpip._vendor.richrr\pip._internal.clir!pip._internal.cli.command_contextr pip._internal.cli.parserr r pip._internal.cli.status_codesr r rrpip._internal.exceptionsrrrrrrpip._internal.utils.filesystemrpip._internal.utils.loggingrrpip._internal.utils.miscrrpip._internal.utils.temp_dirrTempDirRegistryrrpip._internal.utils.virtualenvr__all__ getLoggerrr_rrErBrArsA.."""""" ((((((888888((((((AAAAAAVVVVVVVV <;;;;;OOOOOOOO========UUUUUUQQQQQQQQCCCCCC +  8 $ $FFFFF!FFFFFrB