kgh3 ddlZddlZddlmZddlmZddlmZmZm Z m Z m Z m Z m Z ddlmZddlmZddlmZddlmZdd lmZdd lmZdd lmZmZdd lmZdd lm Z ddl!m"Z"m#Z#er"ddl$m%Z%ddl&m'Z'GddeZ(e e(Z)ej*e+Z,GddeZ-dddede e e e.e e.ffdZ/dddede.fdZ0dS)N)Parser)Values) TYPE_CHECKING GeneratorListOptionalSequenceTuplecastcanonicalize_name)Version) cmdoptions)IndexGroupCommand)SUCCESS) CommandError)BaseDistributionget_environment)SelectionPreferences) stdlib_pkgs)tabulate write_output PackageFinder) PipSessionc(eZdZUdZeed<eed<dS)_DistWithLatestInfozGive the distribution object a couple of extra fields. These will be populated during ``get_outdated()``. This is dirty but makes the rest of the code much cleaner. latest_versionlatest_filetypeN)__name__ __module__ __qualname____doc__r__annotations__str{/builddir/build/BUILD/imunify360-venv-2.6.0/opt/imunify360/venv/lib/python3.11/site-packages/pip/_internal/commands/list.pyrrs6   r'rceZdZdZdZdZddZdeddffd Zded d dd fd Z ded e e de fdZ dddeddfdZdddeddfdZdddeddfdZdddededfdZdddeddfdZde e e de e ddfdZxZS) ListCommandzt List installed packages, including editables. Packages are listed in a case-insensitive sorted order. Tz %prog [options]returnNc|jddddd|jddddd |jd d ddd |jd dddd|jddddd|jtj|jdddd|jdddddd|jdddd |jd!d"d#d$ |jd%dd#d&d'(|jtjtjtj|j}|jd)||jd)|jdS)*Nz-oz --outdated store_trueFzList outdated packages)actiondefaulthelpz-uz --uptodatezList uptodate packagesz-ez --editablezList editable projects.z-lz--localzSIf in a virtualenv that has global access, do not list globally-installed packages.z--useruserz,Only output packages installed in user-site.)destr.r/r0z--prezYInclude pre-release and development versions. By default, pip only finds stable versions.z--formatstore list_formatcolumns)r5freezejsonzSelect the output format among: columns (default), freeze, or json. The 'freeze' format cannot be used with the --outdated option.)r.r2r/choicesr0z--not-required not_requiredz>List packages that are not dependencies of installed packages.)r.r2r0z--exclude-editable store_falseinclude_editablez%Exclude editable package from output.z--include-editablez#Include editable package in output.T)r.r2r0r/r) cmd_opts add_optionr list_path list_excludemake_option_group index_groupparserinsert_option_group)self index_optss r( add_optionszListCommand.add_options2sp    ) !       ) !       * !       / !    ? !      !5!7!7888   2 !      1Q !    Q !       #8 !     #6 !      !8!:!:;;;1*2H$+VV  '':666 ''4=99999r'optionscj|js|jr#t|dSdSN)outdateduptodatesuperhandle_pip_version_check)rDrG __class__s r(rMz$ListCommand.handle_pip_version_checks@   6w/ 6 GG , ,W 5 5 5 5 5 6 6r'sessionrrcddlm}ddlm}|||}t d|j}|j||S)zK Create a package finder appropriate to this list command. r) LinkCollectorr)rGF) allow_yankedallow_all_prereleases)link_collectorselection_prefs)pip._internal.index.collectorrQ"pip._internal.index.package_finderrcreaterpre)rDrGrOrQrrTrUs r(_build_package_finderz!ListCommand._build_package_finders @?????DDDDDD&--gw-GG/")+    $}#)+    r'argsc|jr|jrtd|jr|jdkrtdt j|t t}|jr$| d|jDdt|j  |j |j|j|j|D}|jr|||}|jr|||}n|jr|||}|||t,S)Nz5Options --outdated and --uptodate cannot be combined.r6z?List format 'freeze' cannot be used with the --outdated option.c34K|]}t|VdSrIr ).0ns r( z"ListCommand.run..s+GG)!,,GGGGGGr'c.g|]}td|S)r)r )r^ds r( z#ListCommand.run..s3 % % %  & * * % % % r') local_only user_onlyeditables_onlyinclude_editablesskip)rJrKrr4rcheck_list_path_optionsetrexcludesupdaterpathiter_installed_distributionslocalr1editabler;r9get_not_required get_outdated get_uptodateoutput_package_listingr)rDrGr[rhpackagess r(runzListCommand.runs|   X 0 XVWW W    3x ? ?Q  )'222;   H KKGGg6FGGG G G G % % $W\22OO"=!,&/")": P % % %    @,,Xw??H   <((7;;HH   <((7;;H ##Hg666r'ru_ProcessedDistscBd|||DS)Nc2g|]}|j|jk|Sr&rversionr^dists r(rcz,ListCommand.get_outdated..s2   "T\11 111r'iter_packages_latest_infosrDrurGs r(rrzListCommand.get_outdated3  77'JJ    r'cBd|||DS)Nc2g|]}|j|jk|Sr&rzr|s r(rcz,ListCommand.get_uptodate..s2   "dl22 222r'r~rs r(rszListCommand.get_uptodaterr'cRd|Dtfd|DS)Nchh|]/}|pdD]}t|j0S)r&)iter_dependenciesr name)r^r}deps r( z/ListCommand.get_not_required..sZ   ..006B   ch ' '    r'c&h|] }|jv |Sr&canonical_name)r^pkgdep_keyss r(rz/ListCommand.get_not_required..s&SSSS0B(0R0RS0R0R0Rr')list)rDrurGrs @r(rqzListCommand.get_not_requiredsF      SSSSHSSSTTTr')rNNc#K|5}||dddtdffd }t||D]}||V ddddS#1swxYwYdS)Nr}rr+c|j}js d|D}|j}||}|dS|j}|jjrd}nd}||_||_ |S)Nc*g|]}|jj|Sr&)r{ is_prerelease)r^ candidates r(rczOListCommand.iter_packages_latest_infos..latest_info..s4&&&%(0>&!&&&r') project_namewheelsdist) find_all_candidatesrrYmake_candidate_evaluatorsort_best_candidater{linkis_wheelrr)r}all_candidates evaluatorbest_candidateremote_versiontypfinderrGs r( latest_infoz;ListCommand.iter_packages_latest_infos..latest_infos"(!;!;D!>~!N!N!)4!/!7!&/"!CC!C&4#'*$ r')_build_sessionrZrmap)rDrurGrOrr}rs ` @r(rz&ListCommand.iter_packages_latest_infoss  ) )! W//AAF + /0       8K22  #JJJ ?! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! sAA..A25A2ct|d}|jdkr-|r+t||\}}|||dS|jdkrO|D]J}|jdkr"t d|j|j|j/t d|j|jKdS|jdkrt t||dSdS) Nc|jSrIr)r}s r(z4ListCommand.output_package_listing..s T0r')keyr5r6z %s==%s (%s)z%s==%sr7) sortedr4format_for_columnsoutput_package_listing_columnsverboserraw_namer{locationformat_for_json)rDrurGdataheaderr}s r(rtz"ListCommand.output_package_listings 00     ) + + +-h@@LD&  / /f = = = = =  H , ,  H H?a'' %t}dlDM!4=$,GGGG  H H F * * 7;; < < < < <+ *r'rrc0t|dkr|d|t|\}}t|dkr3|ddd|D|D]}t |dS)Nrr c3 K|] }d|zV dS)-Nr&r^xs r(r`z=ListCommand.output_package_listing_columns..4s&*B*Bq37*B*B*B*B*B*Br')leninsertrjoinr)rDrr pkg_stringssizesvals r(rz*ListCommand.output_package_listing_columns)s t99q== KK6 " " "%d^^ U t99q==   q#((*B*BE*B*B*B"B"B C C C  C       r')r+N)r r!r"r#ignore_require_venvusagerFrrMrZrr%intrvrrrsrqrrrtr __classcell__)rNs@r(r*r*'s  EV:V:V:V:p664666666  (4     .'6'c's''''R ) 4:      ) 4:      U) U4: U  U U U U$)$4:$ 4 5$$$$L=)=4:= ====*cO-1#Y r'r*pkgsrwrGr+c ddg}|j}|r|ddgdtdttfd fd|D}t |}|r|d |jd kr|d |jd kr|d t d |D}|r|dg}t|D]\}} | j | j g} |rA| t | j | | j |r| ||pd|r| | j pd|jd kr| | jpd|jd kr| | j|| ||fS)z_ Convert the package data into something usable by output_package_listing_columns. PackagerLatestTyper}r+c |d}n#t$rYdSwxYwt|dS)NWHEELBuild) read_textFileNotFoundErrorrparsestrget)r} wheel_files r(wheel_build_tagz+format_for_columns..wheel_build_tagGsb 00JJ    44 xx  ,,00999s  &&c&g|] }|Sr&r&)r^prs r(rcz&format_for_columns..Ns#333//!$$333r'rrLocation Installerc3$K|] }|jV dSrI)rprs r(r`z%format_for_columns..Xs$11q 111111r'zEditable project location)rJextendrrr%anyappendr enumerater raw_versionrreditable_project_locationr installer) rrGrrunning_outdated build_tagshas_build_tags has_editablesriprojrowrs @r(rr:s' #F'* x())):.:8C=::::4333d333J__N g! j!!!! k"""11D11111M3 1222 DT??4}d./  - JJs4.// 0 0 0 JJt+ , , ,  , JJz!}* + + +  = JJt5; < < < ?a   JJt}* + + + ?a   JJt~ & & & C <r'rucHg}|D]}|jt|jd}|jdkr|jpd|d<|j|d<|jr!t|j|d<|j|d<|j }|r||d<| |tj |S) N)rr{rrrrrrr) rr%r{rrrrJrrrrr7dumps)rurGrr}infors r(rrvs DM4<((   ?a  #}2D  $D    ;%()<%=%=D! "&*&:D" #$($B! $ J0ID, - D :d  r')1r7logging email.parserroptparsertypingrrrrr r r pip._vendor.packaging.utilsr pip._vendor.packaging.versionrpip._internal.clirpip._internal.cli.index_commandrpip._internal.cli.status_codesrpip._internal.exceptionsrpip._internal.metadatarr$pip._internal.models.selection_prefsrpip._internal.utils.compatrpip._internal.utils.miscrrrWrpip._internal.network.sessionrrrw getLoggerr loggerr*r%rrr&r'r(rsT RRRRRRRRRRRRRRRRRR999999111111((((((======222222111111DDDDDDDDEEEEEE222222;;;;;;;;4@@@@@@888888.23O  8 $ $PPPPP#PPPf9 9&,9 4S ?DI %&9999x/&Sr'