a  ze@s<dZddlZddlZddlZddlZddlZddlZddlmZddlm Z m Z m Z m Z ddl mZddlmZddlmZmZddlmZmZmZmZdd lmZmZmZmZmZmZdd l m!Z!dd l"m#Z#dd l$m%Z%m&Z&dd l'm(Z(m)Z)ddl*m+Z,ddl*m-Z-m.Z.ddl/m0Z0dgZ1e2e3Z4GdddeZ5dS)z(Base Command class, and related routinesN)Values)AnyListOptionalTuple) cmdoptions)CommandContextMixIn)ConfigOptionParserUpdatingDefaultsHelpFormatter)ERRORPREVIOUS_BUILD_DIR_ERROR UNKNOWN_ERRORVIRTUALENV_NOT_FOUND) BadCommand CommandErrorInstallationErrorNetworkConnectionErrorPreviousBuildDirErrorUninstallationError) deprecated)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 e edddZe eee e fdddZe eedddZe eedddZZS)rusageFignore_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_optsrmake_option_group general_groupadd_option_group add_options)selfr#r$r% optgroup_namegen_opts __class__`/opt/bitninja-python-dojo/embedded/lib/python3.9/site-packages/pip/_internal/cli/base_command.pyr-.s*   zCommand.__init__)r&cCsdSNr=)r8r=r=r>r7LszCommand.add_options)optionsr&cCst|drJdS)zf This is a no-op so that commands by default do not do the pip version check. no_indexN)hasattr)r8r@r=r=r>handle_pip_version_checkOsz Command.handle_pip_version_check)r@argsr&cCstdSr?)NotImplementedError)r8r@rDr=r=r>runXsz Command.run)rDr&cCs |j|Sr?)r/ parse_argsr8rDr=r=r>rG[szCommand.parse_argscCsXzH|$||WdWtS1s40YWtn t0dSr?) main_context_mainloggingshutdownrHr=r=r>main_s  z Command.mainc Cs|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|_t|ddrtd d d d d d|jvrtdzz.|||}t|t sJ|WW|!|St"y|}z8tt#|tj$dddt%WYd}~W|!|Sd}~0t&t't(t)fy}z8tt#|tj$dddt*WYd}~W|!|Sd}~0t+y"}z6td|tj$dddt*WYd}~W|!|Sd}~0t,ylt-dtj.d|t/j0krXt1j2tj.dt*YW|!|St3ytdtj$dddt*YW|!|St4ytjdddt5YW|!|S0W|!|n |!|0dS)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. build_dirz\The -b/--build/--build-dir/--build-directory option is deprecated and has no effect anymore.zOuse the TMPDIR/TEMP/TMP environment variable, possibly combined with --no-cleanz21.3i )reason replacementgone_inissuez 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.zException information:T)exc_infoz%sz ERROR: Pipe to stdout was broken)filezOperation cancelled by userz Exception:)6 enter_contextrrrGverbosequietrNrrOlogno_inputosenviron exists_actionjoin require_venvr"rloggercriticalsysexitr cache_dirrrwarninggetattrrfeatures_enabledrF isinstanceintrCrstrdebugr rrrrr rrprintstderrrKDEBUG traceback print_excKeyboardInterrupt BaseExceptionr )r8rDr@ level_numberstatusexcr=r=r>rJfs           ' "         z Command._main)F)__name__ __module__ __qualname__r!ro__annotations__r"boolr-r7rrCrrrnrFrrGrMrJ __classcell__r=r=r;r>r*s    )6r.rKlogging.configr1r`rgrtrtypingrrrrZpip._internal.clir!pip._internal.cli.command_contextrpip._internal.cli.parserr r pip._internal.cli.status_codesr r r rpip._internal.exceptionsrrrrrrpip._internal.utils.deprecationrpip._internal.utils.filesystemrpip._internal.utils.loggingrrpip._internal.utils.miscrrpip._internal.utils.temp_dirrTempDirRegistryrrpip._internal.utils.virtualenvr__all__ getLoggerr{rerr=r=r=r>s.