U ʗRe@sLdZddlZddlZddlZddlZddlZddlZddlZddlmZddl m Z m Z m Z m Z mZddlmZddlmZddlmZddlmZmZdd lmZmZmZmZdd lmZmZm Z m!Z!m"Z"m#Z#m$Z$dd l%m&Z&dd l'm(Z(m)Z)dd l*m+Z+m,Z,ddl-m.Z/ddl-m0Z0m1Z1ddl2m3Z3dgZ4e5e6Z7GdddeZ8dS)z(Base Command class, and related routinesN)Values)AnyCallableListOptionalTuple) traceback) cmdoptions)CommandContextMixIn)ConfigOptionParserUpdatingDefaultsHelpFormatter)ERRORPREVIOUS_BUILD_DIR_ERROR UNKNOWN_ERRORVIRTUALENV_NOT_FOUND) BadCommand CommandErrorDiagnosticPipErrorInstallationErrorNetworkConnectionErrorPreviousBuildDirErrorUninstallationError)check_path_owner)BrokenStdoutLoggingError setup_logging)get_prognormalize_path)TempDirectoryTypeRegistry)global_tempdir_managertempdir_registry)running_under_virtualenvCommandcseZdZUdZeed<dZeed<deeeddfdd Zdd d d Z e dd d dZ e e ee dddZe eee e efdddZe ee dddZe ee dddZZS)r!usageFignore_require_venvN)namesummaryisolatedreturnc st||_||_t|jtd|td||j|d|_ d|_ |j d}t |j ||_ttj|j }|j ||dS)N F)r#prog formatteradd_help_optionr% descriptionr'z Options)super__init__r%r&r r#rr __doc__parserr capitalizeoptparse OptionGroupcmd_optsr make_option_group general_groupadd_option_group add_options)selfr%r&r' optgroup_namegen_opts __class__/builddir/build/BUILDROOT/alt-python38-pip-22.2.1-2.el8.x86_64/opt/alt/python38/lib/python3.8/site-packages/pip/_internal/cli/base_command.pyr/1s*   zCommand.__init__)r(cCsdSNr?)r:r?r?r@r9OszCommand.add_options)optionsr(cCst|drtdS)zf This is a no-op so that commands by default do not do the pip version check. no_indexN)hasattrAssertionError)r:rBr?r?r@handle_pip_version_checkRsz Command.handle_pip_version_check)rBargsr(cCstdSrA)NotImplementedError)r:rBrGr?r?r@run[sz Command.runrGr(cCs |j|SrA)r1 parse_argsr:rGr?r?r@rK^szCommand.parse_argsc Cs>z.|||W5QRW SQRXW5tXdSrA)loggingshutdown main_context_mainrLr?r?r@mainbs $z Command.mainc sF|t|_|t||\}}|j|j|_t|j|j|j d|j rZdt j d<|j rrd|j t j d<|jr|jststdtt|jrt|j|_t|jstd|jd|_d|jkrtd td tftd tfd fd d }z4|js||j }n|j }t!j"dd|||WS||XdS)N) verbosityno_color user_log_file1 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.z 2020-resolverz--use-feature=2020-resolver no longer has any effect, since it is now the default dependency resolver in pip. This will become an error in pip 21.0..)run_funcr(cs$tttdfdd }|S)NrJc sz|}t|tst|WStk rb}z&td|tjdddtWYSd}~XYnptk r}z(t t |tjdddt WYSd}~XYn*t t ttfk r}z(t t |tjdddtWYSd}~XYntk r:}z&t d|tjdddtWYSd}~XYntk rztdtjdtjkrrtjtjdtYStk rt dtjdddtYStk rtj d ddtYSXdS) Nz[present-rich] %szException information:T)exc_infoz%sz ERROR: Pipe to stdout was broken)filezOperation cancelled by userz Exception:) isinstanceintrErloggererrordebugr rcriticalstrrrrrrrrprintsysstderrrMDEBUGr print_excKeyboardInterrupt BaseExceptionr)rGstatusexc) level_numberrXr?r@exc_logging_wrappersJ    zLCommand._main..intercepts_unhandled_exc..exc_logging_wrapper) functoolswrapsrr\)rXrlrk)rXr@intercepts_unhandled_excs0z/Command._main..intercepts_unhandled_excT) show_locals)# enter_contextrrrKverbosequietrRrrSlogno_inputosenviron exists_actionjoin require_venvr$r r]r`rcexitr cache_dirrrwarningfeatures_enabledrr\rF debug_moderIrich_tracebackinstall)r:rGrBrprIr?ror@rPisN           6  z Command._main)F)__name__ __module__ __qualname__r#ra__annotations__r$boolr/r9rrFrr\rIrrKrQrP __classcell__r?r?r=r@r!-s     )9r0rmrMlogging.configr3rwrcrrtypingrrrrrpip._vendor.richrZpip._internal.clir !pip._internal.cli.command_contextr pip._internal.cli.parserr r pip._internal.cli.status_codesr rrrpip._internal.exceptionsrrrrrrrpip._internal.utils.filesystemrpip._internal.utils.loggingrrpip._internal.utils.miscrrpip._internal.utils.temp_dirrTempDirRegistryrrpip._internal.utils.virtualenvr __all__ getLoggerrr]r!r?r?r?r@s0    $