\hG8dZddlZddlZddlZddlmZddlmZddlm 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;ejxe=Z>de dfdZ?GddeZ@Gdd ee@ZAe7je7je7jgZEd&d!ZFd"e de fd#ZGGd$d%eAZHy)'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#ctjdkr td ddl} ddlm}|j|jS#t$rt j dYywxYw#t$r}td|d}~wwxYw)N) z9The truststore feature is only available for Python 3.10+rz1Disabling truststore since ssl support is missing) truststorez'The truststore feature is unavailable: ) sys version_inforssl ImportErrorloggerwarning pip._vendorr(r#PROTOCOL_TLS_CLIENT)r+r(es `/root/niggaflix-v3/playground/venv/lib/python3.12/site-packages/pip/_internal/cli/req_command.py_create_truststore_ssl_contextr32s '!VWW J*  !8!8 99 JK JDQCHIIJs(AA*A'&A'* B3BBc eZdZdZd fd Zededeee fdZ dede fdZ d dedee dee d ede f d ZxZS) SessionCommandMixinzE A class mixin for command classes needing _build_session(). r$c0t|d|_yN)super__init___session)self __class__s r2r9zSessionCommandMixin.__init__Js .2 optionscg}t|dds t|dd}|r|j|t|dd}|r|j||xsdS)z7Return a list of index urls from user-provided options.no_indexF index_urlNextra_index_urls)getattrappendextend)clsr> index_urlsurlurlss r2_get_index_urlsz#SessionCommandMixin._get_index_urlsNs_ w E2';5C!!#&w 2D9    d #!T!r=c|j3|j|j||_|jJ|jS)zGet a default-managed session.)r: enter_context_build_session)r;r>s r2get_default_sessionz'SessionCommandMixin.get_default_session\sE ==  ..t/B/B7/KLDM==, ,,}}r=retriestimeoutfallback_to_certific|j}|r!tjj|sJd|jvr t }nd}t|r tjj|dnd||n |j|j|j||}|jr|j|_ |jr|j|_ |js|r||n |j|_|j r|j |j d|_|j$ |j&_|j*|j&_|S#t $r |sd}Y*wxYw)Nr(zhttp-v2)cacherO trusted_hostsrG ssl_context)httphttps) cache_dirospathisabsfeatures_enabledr3 ExceptionrjoinrOrTrJcertverify client_certrPproxyproxiesno_inputauth promptingkeyring_provider)r;r>rOrPrQrXrUsessions r2rMz"SessionCommandMixin._build_sessionfsE%%  i 888 733 3 #<> K8A"'',,y)4t&2G!//++G4#   <<$\\GN   "..GL ??g)0)r$Nct|dsJ|js |jry|j|dt d|j d}|5t ||dddy#1swYyxYw)z Do the pip version check if not disabled. This overrides the default behavior of not doing the check. r@NrT)rOrPrQ)hasattrdisable_pip_version_checkr@rMminrPr)r;r>rhs r2handle_pip_version_checkz*IndexGroupCommand.handle_pip_version_checks|w +++  , ,0@0@ %% 7??+ !%&   5 "7G 4 5 5 5s  A))A2)rjrkrlrmrr{r=r2rurus 5545r=ructryttdsytjdk(stjdk(rytj dk7ryt jdy)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"rxrYr)platformr~r-r.r|r=r2warn_if_run_as_rootrsX ! 2x   ||w#,,(": yy{a NN ,r=funcc |dtddfddtdtdttdt t ffd }|S) zNDecorator for common logic related to managing temporary directories. registryr$Nc>tD]}|j|dy)NF)KEEPABLE_TEMPDIR_TYPES set_delete)rts r2configure_tempdir_registryz0with_cleanup..configure_tempdir_registrys!' *A   5 ) *r=r;r>argsc|jJ|jr|j |||S#t$r|jwxYwr7)tempdir_registryno_cleanr)r;r>rrrs r2wrapperzwith_cleanup..wrappersd$$000    &t'<'< = gt, ,$  't'<'< =   s 9A)r RequirementCommandrrrrrp)rrrs` @r2 with_cleanuprsK *-F*4* +19=c # Nr=cheZdZdededdffd ZededefdZe dde ded e d e d e d ed eededefdZe dded e dedeed edededededeedeeedfdefdZdeeded e d e deef dZed e ddfdZ d ded e deedeede f dZxZS)!rrkwr$Nc~t||i||jjt j yr7)r8r9cmd_opts add_optionr r)r;rrr<s r2r9zRequirementCommand.__init__s0 $%"%   !4!4!67r=r>c"d|jvryy)zEDetermines which resolver should be used, based on the given options.zlegacy-resolverlegacy resolvelib)deprecated_features_enabledr>s r2determine_resolver_variantz-RequirementCommand.determine_resolver_variants  C C Cr=temp_build_dir build_trackerrhfinder use_user_site download_dir verbosityc |j} | Jd} |j|} | dk(r&d|jv} | r=tj dn'd} d} d|jvrtj dt | |j ||j|j|||j||j|| || S)zQ Create a RequirementPreparer instance for the given parameters. Frz 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_depsrrh progress_barrrequire_hashesr lazy_wheelrlegacy_resolver) rZrr\r-r.rrrrrr) rFrr>rrhrrrrtemp_build_dir_pathrresolver_variantrs r2make_requirement_preparerz,RequirementCommand.make_requirement_preparers-11"...99'B | +$(@(@@J"#OJg666Q#)OO%#33$55' --"11'!+  r=preparer wheel_cacheignore_installedignore_requires_pythonforce_reinstallupgrade_strategy use_pep517py_version_info.c tt|j| } |j|} | dk(rRddl}|j j jjj|||| ||j|||| |  Sddl }|j j jjj|||| ||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 resolutionrresolverResolverr(pip._internal.resolution.legacy.resolverr)rFrrr>rrrrrrrrrrpips r2 make_resolverz RequirementCommand.make_resolverEs$# '**!  99'B | + ?==++66??HH!'!1+$+$?$?!1'= /!1 /I   8}}''..77@@#-' ' ; ;-#9+-+A  r=c *g}|jD]@}t|d|||D]+}t||jd}|j |-B|D]C} t | d|j|j dt|dd}|j |E|jD]B} t| d|j|j t|dd}|j |D|jD]r}t|||| D]^}t||j|j d|jr|jjdnd }|j |`ttd |Drd|_|s|js|jstd |ji} |j r?t#d j$dit'| dj)|j t#dj$di| |S)zS Parse command-line arguments into the corresponding requirements. T) constraintrr>rhF)r user_suppliedNconfig_settings) comes_fromrrrr)rrrr)rr>rh)rrrrc34K|]}|jywr7)has_hash_options).0reqs r2 z6RequirementCommand.get_requirements..s<s##getanyrr find_linksrformatdictr^) r;rr>rrhrfilename parsed_req req_to_addroptss r2get_requirementsz#RequirementCommand.get_requirementssW24 ++ 0H0  0 A$22"' ##J/ 0 0 ,C. .."--" '1BD I J    + ,$$ ,C2" .."-- '1BD I J    + , ,, 0H0' 0 A$22&11"&!))%/$6$6$:$:;L$M ##J/ 0 0 <|< <%)G "))W-A-ADII&D!!"E>>Dft388G4F4F+GH#5..4f=7;= r=cl|j}|j}|rtj|yy)zE Trace basic information about the provided objects. N) search_scopeget_formatted_locationsr-info)rr locationss r2trace_basic_infoz#RequirementCommand.trace_basic_infos1 **  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)r;r>rhrrrrs r2_build_package_finderz(RequirementCommand._build_package_finders]'--gwG."11")++!//#9  ##)+'  r=)Nr)NFTFFzto-satisfy-onlyNN)NN)rjrkrlrr9 staticmethodrrorrnrrrrrqrrprrr r rrrrrrrrrrrss@r2rrs!8c888 Fs'+4 %4 4 $ 4  4  4 4 sm4 4  4 4 l -1#!%', % 1%)598 %8 8  8 j) 8  8 8 !%8 8 8 TN8 "%S/28  8 8 tR3iRR R  R  ! Rh##4##1515     -  !)    r=rri)IrmloggingrYr) 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# getLoggerrjr-r3r5ru BUILD_ENVEPHEM_WHEEL_CACHE REQ_BUILDrrrrr|r=r2r s <<*(2AH7<E;4E@ :<6D D   8 $:(>:$U-Up 5!4 5H##<ss8y *y r=