;T;wjrddlmZddlZddlZddlmZmZddlmZddl m Z ddl m Z m Z ddlmZddlmZmZdd lmZdd lmZdd lmZdd lmZdd lmZmZddlmZddl m!Z!ddl"m#Z#m$Z$e r"ddl%m&Z&ddl'm(Z(GddeZ)ee)Z*ej+e,Z-GddeZ.d!dZ/d"d Z0dS)#) annotationsN) GeneratorSequence)Parser)Values) TYPE_CHECKINGcastcanonicalize_name)InvalidVersionVersion) cmdoptions)IndexGroupCommand)SUCCESS) CommandError)BaseDistributionget_environment)SelectionPreferences) stdlib_pkgs)tabulate write_output PackageFinder) PipSessionc(eZdZUdZded<ded<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. r latest_versionstrlatest_filetypeN)__name__ __module__ __qualname____doc____annotations__m/builddir/build/BUILD/cloudlinux-venv-1.0.10/venv/lib/python3.11/site-packages/pip/_internal/commands/list.pyrrs6  r&rcteZdZdZdZdZddZdfd Zd d Zd!dZ d"dZ d"dZ d"dZ d#dZ d$dZd%dZxZS)& ListCommandzt List installed packages, including editables. Packages are listed in a case-insensitive sorted order. Tz %prog [options]returnNonec|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_options5sp    ) !       ) !       * !       / !    ? !      !5!7!7888   2 !      1Q !    Q !       #8 !     #6 !      !8!:!:;;;1*2H$+VV  '':666 ''4=99999r&optionsrcj|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&args list[str]intc|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[rjpackagess 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&rw_ProcessedDistscBd|||DS)Nc2g|]}|j|jk|Sr%rversionr`dists r'rez,ListCommand.get_outdated..s2   "T\11 111r&iter_packages_latest_infosrDrwrGs r'rtzListCommand.get_outdated3  77'JJ    r&cBd|||DS)Nc2g|]}|j|jk|Sr%r|r~s r'rez,ListCommand.get_uptodate..s2   "dl22 222r&rrs r'ruzListCommand.get_uptodaterr&cRd|Dtfd|DS)Nchh|]/}|pdD]}t|j0S)r%)iter_dependenciesr name)r`rdeps 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)rDrwrGrs @r'rszListCommand.get_not_requiredsF      SSSSHSSSTTTr&*Generator[_DistWithLatestInfo, None, None]c#K|5}||dfd }t||D]}||V ddddS#1swxYwYdS)Nrrr*_DistWithLatestInfo | Nonec|j}js d|D}|j}||}|dS|j}|jjrd}nd}||_||_ |S)Nc*g|]}|jj|Sr%)r} is_prerelease)r` candidates r'rezOListCommand.iter_packages_latest_infos..latest_info..s4&&&%(0>&!&&&r&) project_namewheelsdist) find_all_candidatesrrYmake_candidate_evaluatorsort_best_candidater}linkis_wheelrr)rall_candidates evaluatorbest_candidateremote_versiontypfinderrGs r' latest_infoz;ListCommand.iter_packages_latest_infos..latest_infos"(!;!;D!>~!N!N!)4!/!7!&/"!CC!C&4#'*$ r&)rrr*r)_build_sessionrZmap)rDrwrGrOrrrs ` @r'rz&ListCommand.iter_packages_latest_infoss  ) )! W//AAF       8K22  #JJJ ?! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! s7AA#&A#ct|d}|jdkr-|r+t||\}}|||dS|jdkrl|D]g} |jd|j}n!#t $r|jd|j}YnwxYw|jdkrtd||j Xt|hdS|jd krtt||dSdS) Nc|jSrIr)rs r'z4ListCommand.output_package_listing..s T0r&)keyr5r6z==z===z%s (%s)r7) sortedr4format_for_columnsoutput_package_listing_columnsraw_namer}r raw_versionverboserlocationformat_for_json)rDrwrGdataheaderr req_strings r'rvz"ListCommand.output_package_listingsQ 00     ) + + +-h@@LD&  / /f = = = = =  H , ,  - -I$(M!C!CT\!C!CJJ%III$(M!H!Hd6F!H!HJJJI?a'' J FFFF ,,,, - - F * * 7;; < < < < <+ *sA--B  B rlist[list[str]]rc0t|dkr|d|t|\}}t|dkr3|ddd|D|D]}t |dS)Nrr c3 K|] }d|zV dS)-Nr%r`xs r'rbz=ListCommand.output_package_listing_columns..9s&*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*r+)rGrr*r+)rGrrOrr*r)rGrr[r\r*r])rwryrGrr*ry)rwryrGrr*r)rwryrGrr*r+)rrrr\r*r+)r r!r"r#ignore_require_venvusagerFrMrZrxrtrursrrvr __classcell__)rNs@r'r)r)*s  EV:V:V:V:p666666    .''''R         U U U U$$$$L====.r&r)pkgsryrGrr*!tuple[list[list[str]], list[str]]c ddg}|j}|r|ddgdd  fd |D}t|}|r|d |jd kr|d |jd kr|dtd|D}|r|dg}t |D]\}} | j| jg} |rA| t| j | | j |r| ||pd|r| | j pd|jd kr| | j pd|jd kr| | j || ||fS)z_ Convert the package data into something usable by output_package_listing_columns. Packager LatestTyperrr* str | Nonec |d}n#t$rYdSwxYwt|dS)NWHEELBuild) read_textFileNotFoundErrorrparsestrget)r wheel_files r'wheel_build_tagz+format_for_columns..wheel_build_tagLsb 00JJ    44 xx  ,,00999s  &&c&g|] }|Sr%r%)r`prs r'rez&format_for_columns..Ss#333//!$$333r&rrLocation Installerc3$K|] }|jV dSrI)rrrs r'rbz%format_for_columns..]s$11q 111111r&zEditable project location)rrr*r)rJextendanyappendr enumeraterrrrreditable_project_locationr installer) rrGrrunning_outdated build_tagshas_build_tags has_editablesriprojrowrs @r'rr?s #F'* x()))::::4333d333J__N g! j!!!! k"""11D11111M3 1222 DT??4}d./  - JJs4.// 0 0 0 JJt+ , , ,  , JJz!}* + + +  = JJt5; < < < ?a   JJt}* + + + ?a   JJt~ & & & C <r&rwrc~g}|D]} t|j}n#t$r |j}YnwxYw|j|d}|jdkr|jpd|d<|j|d<|jr!t|j |d<|j |d<|j }|r||d<| |tj|S) N)rr}rrrrrrr)rr}r rrrrrrJrrrrr7dumps)rwrGrrr}infors r'rr{s D '$,''GG ' ' '&GGG 'M   ?a  #}2D  $D    ;%()<%=%=D! "&*&:D" #$($B! $ J0ID, - D :d  s 11)rryrGrr*r)rwryrGrr*r)1 __future__rr7loggingcollections.abcrr email.parserroptparsertypingrr pip._vendor.packaging.utilsr pip._vendor.packaging.versionr r pip._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.sessionrrry getLoggerr loggerr)rrr%r&r'rs""""""" ////////&&&&&&&&999999AAAAAAAA((((((======222222111111DDDDDDDDEEEEEE222222;;;;;;;;4@@@@@@888888.23O  8 $ $RRRRR#RRRj9999xr&