ReV$@sdZddlmZmZddlZddlZddlZddlZddlZddl Z ddl Z ddl m Z ddl mZddlmZmZddlmZmZmZmZddlmZmZmZmZmZmZmZdd lm Z dd l!m"Z"dd l#m$Z$m%Z%dd l&m'Z'm(Z(dd l)m*Z*m+Z+ddl,m-Z-ddl.m/Z/e-rddl0m1Z1m2Z2m3Z3m4Z4ddlm5Z5ddl)m6Z7dgZ8ej9e:Z;GdddeZ<dS)z(Base Command class, and related routines)absolute_importprint_functionN) cmdoptions)CommandContextMixIn)ConfigOptionParserUpdatingDefaultsHelpFormatter)ERRORPREVIOUS_BUILD_DIR_ERROR UNKNOWN_ERRORVIRTUALENV_NOT_FOUND) BadCommand CommandErrorInstallationErrorNetworkConnectionErrorPreviousBuildDirErrorSubProcessErrorUninstallationError) deprecated)check_path_owner)BrokenStdoutLoggingError setup_logging)get_prognormalize_path)global_tempdir_managertempdir_registry)MYPY_CHECK_RUNNING)running_under_virtualenv)ListOptionalTupleAny)Values)TempDirectoryTypeRegistryCommandcsyeZdZdZdZdfddZddZddZd d Zd d Z d dZ ddZ S)r#NFcstt|jd|jddjt|dtddd|d|jd |i}||_||_ t ||_ d|_ d j|jj }tj|j ||_tjtj|j }|j j||jdS) Nusageprogz{} {} formatteradd_help_optionFname descriptionisolatedz {} Options)superr#__init__r$formatrr__doc__r(summaryrparserr capitalizeoptparse OptionGroupcmd_optsrmake_option_group general_groupadd_option_group add_options)selfr(r/r* parser_kw optgroup_namegen_opts) __class__/builddir/build/BUILDROOT/alt-python35-pip-20.2.4-5.el8.x86_64/opt/alt/python35/lib/python3.5/site-packages/pip/_internal/cli/base_command.pyr,>s&        zCommand.__init__cCsdS)Nr>)r9r>r>r?r8^szCommand.add_optionscCst|d stdS)zf This is a no-op so that commands by default do not do the pip version check. no_indexN)hasattrAssertionError)r9optionsr>r>r?handle_pip_version_checkbsz Command.handle_pip_version_checkcCs tdS)N)NotImplementedError)r9rCargsr>r>r?runlsz Command.runcCs|jj|S)N)r0 parse_args)r9rFr>r>r?rHpszCommand.parse_argscCs7z%|j|j|SWdQRXWdtjXdS)N) main_context_mainloggingshutdown)r9rFr>r>r?mainus z Command.maincCs|jt|_|jt|j|\}}|j|j|_td|jd|jd|j }t j ddd&kr|j rd}t jdkrd|}t|d dd d t j ddd'kr |j r d}t|d dd d |jr!dtjd<|jrCdj|jtjd<|jry|j rytsytjdt jt|jrt|j|_t|jstjd|jd|_t |ddrtddd dd dddd|j!krtjdt jt"zy/|j#||}t$|t%sFt&|SWnt'k r}z/tjt(|tj)ddd t*SWYdd}~XnPt+t,t-t.t/fk r}z/tjt(|tj)ddd t"SWYdd}~Xnt0k rD}z,tjd!|tj)ddd t"SWYdd}~Xnt1k rt2d"d#t j3|t4j5krt6j7d#t j3t"SYn^t8k rtjd$tj)ddd t"SYn)t9k rtjd%dd t:SYnXWd|j;|XdS)(N verbosityno_color user_log_filezpip 21.0 will drop support for Python 2.7 in January 2021. More details about Python 2 support in pip can be found at https://pip.pypa.io/en/latest/development/release-process/#python-2-supportCPythonzPython 2.7 reached the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 is no longer maintained. replacementgone_inz21.0zPython 3.5 reached the end of its life on September 13th, 2020. Please upgrade your Python as Python 3.5 is no longer maintained. pip 21.0 will drop support for Python 3.5 in January 2021.1 PIP_NO_INPUT 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 may want sudo's -H flag. build_dirreasonzBThe -b/--build/--build-dir/--build-directory option is deprecated.zOuse the TMPDIR/TEMP/TMP environment variable, possibly combined with --no-cleanz20.3issuei resolverzs--unstable-feature=resolver is no longer supported, and has been replaced with --use-feature=2020-resolver instead.zException information:exc_infoTz%sz ERROR: Pipe to stdout was brokenfilezOperation cancelled by userz Exception:)rQrR)rVrW)< enter_contextrrrHverbosequietrNrrOlogsys version_infono_python_version_warningplatformpython_implementationrno_inputosenviron exists_actionjoin require_venvignore_require_venvrloggercriticalexitr cache_dirrrwarninggetattrunstable_featuresrrG isinstanceintrBrstrdebugr rrr rrr rprintstderrrKDEBUG traceback print_excKeyboardInterrupt BaseExceptionr rD)r9rFrC level_numbermessagestatusexcr>r>r?rJ}s                    z Command._main) __name__ __module__ __qualname__r$rqr,r8rDrGrHrMrJr>r>)r=r?r#:s     )=r. __future__rrrKlogging.configr2rlrirfrZpip._internal.clir!pip._internal.cli.command_contextrpip._internal.cli.parserrrpip._internal.cli.status_codesrr r r pip._internal.exceptionsr r rrrrrpip._internal.utils.deprecationrpip._internal.utils.filesystemrpip._internal.utils.loggingrrpip._internal.utils.miscrrpip._internal.utils.temp_dirrrpip._internal.utils.typingrpip._internal.utils.virtualenvrtypingrrrr r!r"ZTempDirRegistry__all__ getLoggerrrrr#r>r>r>r?s6       "4 "