U ʗRekv@shddlZddlZddlZddlZddlZddlZddlmZmZddl m Z m Z m Z ddl mZddlmZddlmZddlmZddlmZdd lmZmZmZdd lmZmZdd lmZm Z dd l!m"Z"dd l#m$Z$ddl%m&Z&ddl'm(Z(ddl)m*Z*ddl+m,Z,m-Z-ddl.m/Z/ddl0m1Z1ddl2m3Z3ddl4m5Z5ddl6m7Z7ddl8m9Z9ddl:m;Z;mZ>ddl?m@Z@ddlAmBZBmCZCddlDmEZEmFZFmGZGe9eHZIe&eEdddZJGdd d eZKd1eLe eMe eMeLe eMe eMd"d#d$ZNe eMeLeLd%d&d'ZOd2e eLe eMe eMe eMeLeLd(d)d*ZPe e1e e eMdd+d,d-ZQeReLeLeMd.d/d0ZSdS)3N) SUPPRESS_HELPValues)IterableListOptional)canonicalize_name) print_json) WheelCache) cmdoptions)make_target_python)RequirementCommandwarn_if_run_as_root with_cleanup)ERRORSUCCESS) CommandErrorInstallationError) get_scheme)get_environment) FormatControl)InstallationReport)get_build_tracker)ConflictDetailscheck_install_conflicts)install_given_reqs)InstallRequirement)WINDOWS)parse_distutils_argstest_writable_dir) getLogger) ensure_dirget_pip_version(protect_pip_from_modification_on_windows write_output) TempDirectory)running_under_virtualenvvirtualenv_no_global)BinaryAllowedPredicatebuild should_build_for_install_command)format_controlreturncsttdfdd }|S)N)reqr,cs t|jp d}|}d|kS)Nbinary)rnameget_allowed_formats)r-canonical_nameallowed_formatsr+/builddir/build/BUILDROOT/alt-python38-pip-22.2.1-2.el8.x86_64/opt/alt/python38/lib/python3.8/site-packages/pip/_internal/commands/install.pycheck_binary_allowed8s z6get_check_binary_allowed..check_binary_allowed)rbool)r+r7r5r4r6get_check_binary_allowed7sr9c@szeZdZdZdZddddZeeee e ddd Z e e e dd d d Zeeeed ddZee ddddZdS)InstallCommandaI Install packages from: - PyPI (and other indexes) using requirement specifiers. - VCS project urls. - Local project directories. - Local or remote source archives. pip also supports installing from "requirements files", which provide an easy way to specify a whole environment to be installed. a% %prog [options] [package-index-options] ... %prog [options] -r [package-index-options] ... %prog [options] [-e] ... %prog [options] [-e] ... %prog [options] ...N)r,cCs|jt|jt|jt|jt|jt|jjdddddd|jjddd d dd d t|j|jjd dddd|jjdddt d|jjddd ddd |jjddd ddd |jt |jjdddddd|jjddddd gd!d"|jjd#d$dd%d|jjd&d'd(dd)d|jt |jt |jt |jt|jt|jt|jt|jt|jjd*dd+d,d-d|jjd.dd+d/d0|jjd1dd2d,d3d|jjd4dd5d,d6d|jt|jt|jt|jt|jt|jtttj|j}|jd7||jd7|j|jjd8d9d:dd;d dS). By default this will not replace existing files/folders in . Use --upgrade to replace existing packages in with new versions.)r>metavarr?r@z--user use_user_sitezInstall to the Python user install directory for your platform. Typically ~/.local/, or %APPDATA%\Python on Windows. (See the Python documentation for site.USER_BASE for full details.))r>r=r@z --no-user store_falsez--root root_pathz=Install everything relative to this alternate root directory.z--prefix prefix_pathzIInstallation prefix where lib, bin and other top-level folders are placedz-Uz --upgradeupgradezUpgrade all specified packages to the newest available version. The handling of dependencies depends on the upgrade-strategy used.z--upgrade-strategyupgrade_strategyzonly-if-neededeageraGDetermines how dependency upgrading should be handled [default: %default]. "eager" - dependencies are upgraded regardless of whether the currently installed version satisfies the requirements of the upgraded package(s). "only-if-needed" - are upgraded only when they do not satisfy the requirements of the upgraded package(s).)r>r?choicesr@z--force-reinstallforce_reinstallz;Reinstall all packages even if they are already up-to-date.z-Iz--ignore-installedignore_installedzIgnore the installed packages, overwriting them. This can break your system if the existing package is of a different version or was installed with a different package manager!z --compilecompileTz'Compile Python source files to bytecodez --no-compilez.Do not compile Python source files to bytecode)r=r>r@z--no-warn-script-locationwarn_script_locationz0Do not warn when installing scripts outside PATHz--no-warn-conflictswarn_about_conflictsz%Do not warn about broken dependenciesrz--reportjson_report_filefilezGenerate a JSON file describing what pip did to install the provided requirements. Can be used in combination with --dry-run and --ignore-installed to 'resolve' the requirements. When - is used as file name it writes to stdout.)cmd_opts add_optionr requirements constraintsno_depspreeditableadd_target_python_optionsrsrcignore_requires_pythonno_build_isolation use_pep517 no_use_pep517check_build_depsconfig_settingsinstall_optionsglobal_options no_binary only_binary prefer_binaryrequire_hashes progress_barroot_user_actionmake_option_group index_groupparserinsert_option_group)self index_optsr5r5r6 add_optionsTs      zInstallCommand.add_options)optionsargsr,c, s|jr|jdk rtdt|d}|jr2|j}tj|dd|jpHg}t dt t |j|j |j|j|jd|_d}d}|jrd|_tj|j|_tj|jrtj|jstdtdd }|j}|||jpg}||}t|} |j||| |jd } t|j|j} |t } t|j! d dd } z,|"||| |}|D] }d|_#qLt$||j|j%| || || |j|j&d }|j'|| || |j|j|j|j(||j)d }|*| |j+||j d}|j,r0t -dt.|j/}|j,dkrt0|1dn2t2|j,ddd}t3j4|1|dddW5QRX|j5rrt6dd|j/D}|rlt7dd8dd|Dt9WSz|:d}Wnt;k rd}Yn X|j| jfd d!|j?@D}tA|| dggd"\}}d#d!|D}|rtBd$Cd%8||D]}|j)sd&|_Dq|E|}d}|jF oF|jG}|rX|H|}|jI} |jsn|j rrd} tJ||||j||j | |j|jKd' }!tL|j||j|j |jd(}"tM|"}#|!jNtOPd)d*g}$|!D]V}%|%jQ}&z(|#R|&}'|'dk r|&d|'jS}&WntTk rYnX|$U|&q|dk rF|jV||W|d+d8|$}(|(r`t7d,|(WnRtXk r})z2|j&d-k}*tY|)|*|j}+t jZ|+|*d.t[WYSd})~)XYnX|jr|st\|]|j||j|j^d/krt_t9S)0Nz'Can not combine '--user' and '--target'zto-satisfy-onlyT) check_targetzUsing %s)rGrArF isolated_modez=Target path exists but is not a directory, will not continue.target)kind)rqsession target_pythonr\install)deletervglobally_managed)temp_build_dirrq build_trackerrwfinderrD verbosity) preparerr~rq wheel_cacherDrMr\rLrIr^)check_supported_wheelszu--report is currently an experimental option. The output format may change in a future release without prior warning.-)datawzutf-8)encodingF)indent ensure_asciicss"|]}|jd|jdfVqdS)r0versionN)metadata.0rr5r5r6 sz%InstallCommand.run..zWould install %s css|]}d|VqdS)rN)join)ritemr5r5r6rspip) modifying_pipcsg|]}t|r|qSr5)r*rr7r5r6 s z&InstallCommand.run..)rverify build_optionsrccSsg|]}|jr|jqSr5)r^r0rr5r5r6rszYCould not build wheels for {}, which is required to install pyproject.toml-based projectsz, i )roothomeprefixrOrD pycompile)userrrrisolatedr0)key)resolver_variantzSuccessfully installed %s)exc_infowarn)`rDrArr check_install_build_globalrHrIcheck_dist_restrictionrbloggerverboser"decide_user_installrGrFrtrMospathabspathexistsisdirr% enter_contextrcget_default_sessionr _build_package_finderr\r cache_dirr+rno_cleanget_requirementspermit_editable_wheels'reject_location_related_install_optionsmake_requirement_preparerr make_resolverrLr^trace_basic_inforesolverQwarningrrequirements_to_installrto_dictopenjsondumpr<sortedr$rrget_requirementKeyError satisfied_byr#r9rUvaluesr)rformatlegacy_install_reasonget_installation_orderignore_dependenciesrP_determine_conflictsrOrrNget_lib_location_guessesrsortoperator attrgetterr0get_distributionr Exceptionappend_warn_about_conflictsdetermine_resolver_variantOSErrorcreate_os_error_messageerrorrAssertionError_handle_target_dirrir ),rnrqrrrIrbtarget_temp_dirtarget_temp_dir_pathrcrwrxr~rr} directoryreqsr-rresolverrequirement_setreportfwould_install_itemspip_reqr reqs_to_build_build_failurespep517_build_failure_namesr to_install conflictsshould_warn_about_conflictsrO installed lib_locationsenvitemsresultrinstalled_distinstalled_descrshow_tracebackmessager5rr6runs                                  zInstallCommand.run)rArrHr,c sNt|g}td|jd}|j}|j}|j}tj|rB||tj|r`||kr`||tj|rv|||D]} t | D]} | |krtj || t fdd|ddDrqtj || } tj| r0|st d| qtj| r t d| qtj| r&t| n t| ttj | | | qqzdS)Nr.)rc3s|]}|VqdSN) startswith)rsddirr5r6r*sz4InstallCommand._handle_target_dir..zKTarget directory %s already exists. Specify --upgrade to force replacement.zTarget directory %s already exists and is a link. pip will not automatically replace links, please remove if replacement is desired.)r!rrpurelibplatlibrrrrlistdirranyrrislinkrshutilrmtreeremovemove) rnrArrH lib_dir_listscheme purelib_dir platlib_dirdata_dirlib_dirrtarget_item_dirr5rr6rsH       z!InstallCommand._handle_target_dir)rr,cCs0z t|WStk r*tdYdSXdS)NzwError while checking for conflicts. Please file an issue on pip's issue tracker: https://github.com/pypa/pip/issues/new)rrr exception)rnrr5r5r6rEs z#InstallCommand._determine_conflicts)conflict_detailsrr,c Cs|\}\}}|s|sdSg}|dkr0|dn|dks.rr)allsetrr r5r5r6site_packages_writablesr#)rDrGrArFrtr,cCs|dk r|stddS|rF|r*tdtr8tdtddS|dksRt|sZ|rhtddStjs|td dSt||d rtd dSt d dS) aZDetermine whether to do a user install based on the input options. If use_user_site is False, no additional checks are done. If use_user_site is True, it is checked for compatibility with other options. If use_user_site is None, the default behaviour depends on the environment, which is provided by the other arguments. Nz$Non-user install by explicit requestFzVCan not combine '--user' and '--prefix' as they imply different installation locationszZCan not perform a '--user' install. User site-packages are not visible in this virtualenv.z User install by explicit requestTz3Non-user install due to --prefix or --target optionz4Non-user install because user site-packages disabledr z0Non-user install because site-packages writeablezMDefaulting to user installation because normal site-packages is not writeable) rdebugrr'rrsiteENABLE_USER_SITEr#info)rDrGrArFrtr5r5r6rs8        r)rUrqr,cCsttttddd}g}|D]0}|j}t|}|r |d|||q |rzt|}|rz|d|||sdStdd |dS) zIf any location-changing --install-option arguments were passed for requirements or on the command-line, then show a deprecation warning. ) option_namesr,cSsdd|DS)NcSsg|]}d|ddqS)z--{}rr)rreplace)rr0r5r5r6rszSreject_location_related_install_options..format_options..r5)r(r5r5r6format_optionssz?reject_location_related_install_options..format_optionsz {!r} from {}z{!r} from command lineNzLocation-changing options found in --install-option: {}. This is unsupported, use pip-level options like --user, --prefix, --root, and --target instead.z; ) rrrrbrrrkeysrr)rUrqr* offendersr rblocation_optionsr5r5r6rs2 r)rrusing_user_siter,cCsg}|d|s,|d|t|n |d|dd7<|jtjkrd}d}tsz|sz||d|gn |||d tr|jtjkr|j rt |j d kr|d d | dS) zrFormat an error message for an OSError It may occur anytime during the execution of the install command. z,Could not install packages due to an OSErrorz: .rrz"Consider using the `--user` optionzCheck the permissionsz or z. izHINT: This error might have occurred since this system does not have Windows Long Path support enabled. You can find information on how to enable this at https://pip.pypa.io/warnings/enable-long-paths r.) rrerrnoEACCESr&extendlowerrENOENTfilenamelenrstrip)rrr.ruser_option_partpermissions_partr5r5r6rs>         r)FNNFN)NNNF)Tr0rrrrr%optparserrtypingrrrpip._vendor.packaging.utilsrpip._vendor.richrpip._internal.cacher Zpip._internal.clir Zpip._internal.cli.cmdoptionsr pip._internal.cli.req_commandr r rpip._internal.cli.status_codesrrpip._internal.exceptionsrrpip._internal.locationsrpip._internal.metadatar#pip._internal.models.format_controlr(pip._internal.models.installation_reportr,pip._internal.operations.build.build_trackerrpip._internal.operations.checkrrpip._internal.reqrZpip._internal.req.req_installrpip._internal.utils.compatr"pip._internal.utils.distutils_argsrpip._internal.utils.filesystemrpip._internal.utils.loggingr pip._internal.utils.miscr!r"r#r$pip._internal.utils.temp_dirr%pip._internal.utils.virtualenvr&r'pip._internal.wheel_builderr(r)r*rrr9r:r8rrr#rrrrr5r5r5r6s                  M   >  (