idH0dZddlZddlZddlZddlmZddlmZddlm Z m Z m Z m Z m Z ddlmZddlmZddlmZdd lmZdd lmZmZdd lmZdd lmZdd lmZddlm Z ddl!m"Z"ddl#m$Z$ddl%m&Z&ddl'm(Z(m)Z)m*Z*m+Z+ddl,m-Z-ddl.m/Z/ddl0m1Z1ddl2m3Z3ddl4m5Z5m6Z6m7Z7ddl8m9Z9e rddl:m;Z;ej<e=Z>de dfdZ?GddeZ@Gdd ee@ZAe7jBe7jCe7jDgZEd&d!ZFd"e de fd#ZGGd$d%eAZHdS)'aContains the Command base classes that depend on PipSession. The classes in this module are in a separate module so the commands not needing download / PackageFinder capability don't unnecessarily import the PackageFinder machinery and all its vendored dependencies, etc. N)partial)Values) TYPE_CHECKINGAnyListOptionalTuple) WheelCache) cmdoptions)Command)CommandContextMixIn) CommandErrorPreviousBuildDirError) LinkCollector) PackageFinder)SelectionPreferences) TargetPython) PipSession) BuildTracker)RequirementPreparer)install_req_from_editableinstall_req_from_line#install_req_from_parsed_requirementinstall_req_from_req_string)parse_requirements)InstallRequirement) BaseResolver)pip_self_version_check) TempDirectoryTempDirectoryTypeRegistry tempdir_kinds)running_under_virtualenv) SSLContextreturnr#ctjdkrtd ddl}n+#t$rt dYdSwxYw ddl}n#t$rtdwxYw||j S)N) z9The truststore feature is only available for Python 3.10+rz1Disabling truststore since ssl support is missingz]To use the truststore feature, 'truststore' must be installed into pip's current environment.) sys version_inforssl ImportErrorloggerwarning truststorer#PROTOCOL_TLS_CLIENT)r*r.s R/opt/cloudlinux/venv/lib/python3.11/site-packages/pip/_internal/cli/req_command.py_create_truststore_ssl_contextr12s '!!VWWW JKKKtt      )     !8 9 99s&$A AAA1c eZdZdZd fd Zededeee fdZ dede fdZ dded ee d ee d ede f d ZxZS)SessionCommandMixinzE A class mixin for command classes needing _build_session(). r$NcVtd|_dSN)super__init___session)self __class__s r0r7zSessionCommandMixin.__init__Ms$ .2 optionscg}t|dds(t|dd}|r||t|dd}|r|||pdS)z7Return a list of index urls from user-provided options.no_indexF index_urlNextra_index_urls)getattrappendextend)clsr< index_urlsurlurlss r0_get_index_urlsz#SessionCommandMixin._get_index_urlsQs w E22 '';55C '!!#&&&w 2D99  $   d # # #!T!r;c|j6||||_|jJ|jS)zGet a default-managed session.)r8 enter_context_build_session)r9r<s r0get_default_sessionz'SessionCommandMixin.get_default_session_sE =  ..t/B/B7/K/KLLDM=,,,}r;Fretriestimeoutfallback_to_certificb|j}|r!tj|sJd|jvr% t }n#t $r|sd}YnwxYwd}t|r tj|dnd||n|j |j | ||}|j r |j |_ |jr |j|_ |js|r||n|j|_|jr|j|jd|_|j |j_|j|j_|S)Nr.http)cacherM trusted_hostsrE ssl_context)rQhttps) cache_dirospathisabsfeatures_enabledr1 ExceptionrjoinrMrSrHcertverify client_certrNproxyproxiesno_inputauth promptingkeyring_provider)r9r<rMrNrOrVrTsessions r0rKz"SessionCommandMixin._build_sessionisu% 8 i 8 8888 73 3 3 #<>>  # # #*"  # K5>H"',,y&111D&2GG!/++G44#     < *$\GN   /".GL ? Rg R)0)NrT)rMrNrO)hasattrdisable_pip_version_checkr>rKminrNr)r9r<rfs r0handle_pip_version_checkz*IndexGroupCommand.handle_pip_version_checksw +++++  , 0@  F%% 7?++ !%&    5 5 "7G 4 4 4 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5sA//A36A3)rhrirjrkrryr;r0rsrss@ 554555555r;rsctrdSttdsdStjdkstjdkrdStjdkrdSt ddS)zOutput a warning for sudo users on Unix. In a virtual environment, sudo pip still writes to virtualenv. On Windows, users may run pip as Administrator without issues. This warning only applies to Unix root users outside of virtualenv. Ngetuidwin32cygwinrzRunning pip as the 'root' user can result in broken permissions and conflicting behaviour with the system package manager. It is recommended to use a virtual environment instead: https://pip.pypa.io/warnings/venv)r"rvrWr(platformr|r,r-rzr;r0warn_if_run_as_rootrs !! 2x   |w#,(":": y{{a NN ,r;funcc dtddfddtdtdttdt t ffd }|S) zNDecorator for common logic related to managing temporary directories. registryr$NcFtD]}||ddS)NF)KEEPABLE_TEMPDIR_TYPES set_delete)rts r0configure_tempdir_registryz0with_cleanup..configure_tempdir_registrys4' * *A   5 ) ) ) ) * *r;r9r<argsc|jJ|jr|j |||S#t$r|jwxYwr5)tempdir_registryno_cleanr)r9r<rrrs r0wrapperzwith_cleanup..wrappers$000   > & &t'< = = = 4gt,, ,$    ' &t'< = = =   s 0A )r RequirementCommandrrrrrn)rrrs` @r0 with_cleanuprsy *-F*4**** +19=c # Nr;ceZdZdededdffd ZededefdZe d"d e ded e d e d e d edeededefdZe d#ded e dedeed edededededeedeeedfdefdZdeeded e d e deef dZed e ddfdZ d$ded e d eedeede f d!ZxZS)%rrkwr$Nctj|i||jt jdSr5)r6r7cmd_opts add_optionr r)r9rrr:s r0r7zRequirementCommand.__init__sD$%"%%%   !4!6!677777r;r<cd|jvrdSdS)zEDetermines which resolver should be used, based on the given options.zlegacy-resolverlegacy 2020-resolver)deprecated_features_enabledr<s r0determine_resolver_variantz-RequirementCommand.determine_resolver_variant s  C C C8r;rtemp_build_dir build_trackerrffinder use_user_site download_dir verbosityc X|j} | Jd} ||} | dkr&d|jv} | rtdn'd} d} d|jvrtdt | |j||j|j|||j ||j || || S) zQ Create a RequirementPreparer instance for the given parameters. NFrz fast-depszpip is using lazily downloaded wheels using HTTP range requests to obtain dependency information. This experimental feature is enabled through --use-feature=fast-deps and it is not ready for production.Tz;fast-deps has no effect when used with the legacy resolver.) build_dirsrc_dirrbuild_isolationcheck_build_depsrrf progress_barrrequire_hashesr lazy_wheelrlegacy_resolver) rXrrZr,r-rrrrrr) rDrr<rrfrrrrtemp_build_dir_pathrresolver_variantrs r0make_requirement_preparerz,RequirementCommand.make_requirement_preparers-1"...99'BB  . .$(@@J "#OJg666Q#)O%#3$5' -"1'!+    r;FTto-satisfy-onlypreparer wheel_cacheignore_installedignore_requires_pythonforce_reinstallupgrade_strategy use_pep517py_version_info.c dtt|j| } ||} | dkr=ddl}|jjjj |||| ||j |||| |  Sddl }|jjj j |||| ||j |||| |  S)zF Create a Resolver instance for the given parameters. )isolatedrrrN) rrrmake_install_reqrignore_dependenciesrrrrr) rr isolated_moder,pip._internal.resolution.resolvelib.resolver _internal resolution resolvelibresolverResolverr(pip._internal.resolution.legacy.resolverr)rDrrr<rrrrrrrrrrpips r0 make_resolverz RequirementCommand.make_resolverHs$# '*!    99'BB  . . ? ? ? ?=+6?HH!'!1+$+$?!1'= /!1 /I    8777}'.7@@#-' ' ;-#9+-+A   r;c g}|jD]E}t|d|||D].}t||jd}||/F|D]E} t | d|j|jdt|dd}||F|jD]D} t| d|j|jt|dd}||E|j D]l}t|||| D]V}t||j|jd|j r|j dnd }||Wmtd |Drd|_|sy|jsr|j skd |ji} |jrAt#d jdit'| d|jt#djdi| |S)zS Parse command-line arguments into the corresponding requirements. T) constraintrr<rfF)r user_suppliedNconfig_settings) comes_fromrrrr)rrrr)rr<rf)rrrrc3$K|] }|jV dSr5)has_hash_options).0reqs r0 z6RequirementCommand.get_requirements..s%<<s#<<<<<>Dt388G4F+G+GHHH#5..4==7;== r;cx|j}|}|rt|dSdS)zE Trace basic information about the provided objects. N) search_scopeget_formatted_locationsr,info)rr locationss r0trace_basic_infoz#RequirementCommand.trace_basic_infosG *  88::  # KK " " " " " # #r; target_pythonctj||}td|j|j|j|}t j|||S)z Create a package finder appropriate to this requirement command. :param ignore_requires_python: Whether to ignore incompatible "Requires-Python" values in links. Defaults to False. rT) allow_yankedformat_controlallow_all_prereleases prefer_binaryr)link_collectorselection_prefsr)rcreaterrprerr)r9r<rfrrrrs r0_build_package_finderz(RequirementCommand._build_package_findersi'-gwGGG."1")+!/#9    #)+'    r;)Nr)NFTFFrNN)NN)rhrirjrr7 staticmethodrrmrrlrrrrrorrnrrr r rrrrrrrrrprqs@r0rrs8c88888888 Fs\'+4 4 %4 4 $ 4  4  4 4 sm4 4  4 4 4 [4 l -1#!%', % 1%)598 8 %8 8  8 j) 8  8 8 !%8 8 8 TN8 "%S/28  8 8 8 [8 tR3iRR R  R  ! RRRRh##4###\#1515      -  !)           r;rrg)IrkloggingrWr( functoolsroptparsertypingrrrrr pip._internal.cacher pip._internal.clir pip._internal.cli.base_commandr !pip._internal.cli.command_contextr pip._internal.exceptionsrrpip._internal.index.collectorr"pip._internal.index.package_finderr$pip._internal.models.selection_prefsr"pip._internal.models.target_pythonrpip._internal.network.sessionr,pip._internal.operations.build.build_trackerr pip._internal.operations.preparerpip._internal.req.constructorsrrrrpip._internal.req.req_filerpip._internal.req.req_installrpip._internal.resolution.baser!pip._internal.self_outdated_checkrpip._internal.utils.temp_dirrr r!pip._internal.utils.virtualenvr"r*r# getLoggerrhr,r1r3rs BUILD_ENVEPHEM_WHEEL_CACHE REQ_BUILDrrrrrzr;r0r sd <<<<<<<<<<<<<<******((((((222222AAAAAAHHHHHHHH777777<<<<<<EEEEEE;;;;;;444444EEEEEE@@@@@@ :99999<<<<<<666666DDDDDD DCCCCC  8 $ $:(>::::*UUUUU-UUUp 5 5 5 5 5!4 5 5 5H#<ss8y y y y y *y y y y y r;