ó BuÆ_c@@sddlmZddlZddlZddlmZddlmZddlm Z ddl m Z ddl m Z ddlmZdd lmZdd lmZdd lmZmZmZmZdd lmZdd lmZddlmZerUddlm Z ddl!m"Z"m#Z#m$Z$m%Z%ddl&m'Z'ddl(m)Z)nej*e+ƒZ,de fd„ƒYZ-d„Z.d„Z/dS(i(tabsolute_importN(tsix(t cmdoptions(tIndexGroupCommand(tSUCCESS(t CommandError(t LinkCollector(t PackageFinder(tSelectionPreferences(tdist_is_editabletget_installed_distributionsttabulatet write_output(t get_installer(tmap_multithread(tMYPY_CHECK_RUNNING(tValues(tListtSettTupletIterator(t PipSession(t Distributiont ListCommandcB@skeZdZeZdZd„Zd„Zd„Zd„Z d„Z d„Z d„Z d „Z d „ZRS( st List installed packages, including editables. Packages are listed in a case-insensitive sorted order. s %prog [options]c C@sÓ|jjdddddtddƒ|jjdd dddtdd ƒ|jjd d dddtdd ƒ|jjdddddtddƒ|jjddddddtddƒ|jjtjƒƒ|jjddddtddƒ|jjddddddddd)ddƒ|jjddddd dd!ƒ|jjd"dd#dd$dd%ƒ|jjd&dddd$dd'dtƒtjtj|jƒ}|jj d(|ƒ|jj d(|jƒdS(*Ns-os --outdatedtactiont store_truetdefaultthelpsList outdated packagess-us --uptodatesList uptodate packagess-es --editablesList editable projects.s-ls--localsSIf in a virtualenv that has global access, do not list globally-installed packages.s--usertdesttusers,Only output packages installed in user-site.s--presYInclude pre-release and development versions. By default, pip only finds stable versions.s--formattstoret list_formattcolumnstchoicestfreezetjsonsBSelect the output format among: columns (default), freeze, or jsons--not-requiredt not_requireds>List packages that are not dependencies of installed packages.s--exclude-editablet store_falsetinclude_editables%Exclude editable package from output.s--include-editables%Include editable package from output.i(R R"sjson( tcmd_optst add_optiontFalseRt list_pathtTruetmake_option_groupt index_grouptparsertinsert_option_group(tselft index_opts((sL/opt/alt/python36/lib/python3.6/site-packages/pip/_internal/commands/list.pyt add_options.sv              cC@sCtj|d|ƒ}tdtd|jƒ}tjd|d|ƒS(sK Create a package finder appropriate to this list command. toptionst allow_yankedtallow_all_prereleasestlink_collectortselection_prefs(RtcreateRR)tpreR(R0R3tsessionR6R7((sL/opt/alt/python36/lib/python3.6/site-packages/pip/_internal/commands/list.pyt_build_package_finder{s  c C@sÒ|jr!|jr!tdƒ‚ntj|ƒtd|jd|jd|jd|j d|j ƒ}|j r‚|j ||ƒ}n|jr |j ||ƒ}n|jr¾|j||ƒ}n|j||ƒtS(Ns5Options --outdated and --uptodate cannot be combined.t local_onlyt user_onlyteditables_onlytinclude_editablestpaths(toutdatedtuptodateRRtcheck_list_path_optionR tlocalRteditableR&tpathR$tget_not_requiredt get_outdatedt get_uptodatetoutput_package_listingR(R0R3targstpackages((sL/opt/alt/python36/lib/python3.6/site-packages/pip/_internal/commands/list.pytruns$          cC@s5g|j||ƒD]}|j|jkr|^qS(N(titer_packages_latest_infostlatest_versiontparsed_version(R0RLR3tdist((sL/opt/alt/python36/lib/python3.6/site-packages/pip/_internal/commands/list.pyRH¬scC@s5g|j||ƒD]}|j|jkr|^qS(N(RNRORP(R0RLR3RQ((sL/opt/alt/python36/lib/python3.6/site-packages/pip/_internal/commands/list.pyRI³sc@sQtƒ‰x+|D]#}ˆjd„|jƒDƒƒqWt‡fd†|DƒƒS(Ncs@s|]}|jVqdS(N(tkey(t.0t requirement((sL/opt/alt/python36/lib/python3.6/site-packages/pip/_internal/commands/list.pys ¾sc@s%h|]}|jˆkr|’qS((RR(RStpkg(tdep_keys(sL/opt/alt/python36/lib/python3.6/site-packages/pip/_internal/commands/list.pys Ãs (tsettupdatetrequirestlist(R0RLR3RQ((RVsL/opt/alt/python36/lib/python3.6/site-packages/pip/_internal/commands/list.pyRGºs  !c#@sn|jˆƒY}|jˆ|ƒ‰‡‡fd†}x+t||ƒD]}|dk rF|VqFqFWWdQXdS(Nc@s·d}ˆj|jƒ}ˆjsIg|D]}|jjs(|^q(}nˆjd|jƒ}|j|ƒ}|dkr}dS|j}|j j r›d}nd}||_ ||_ |S(Ntunknownt project_nametwheeltsdist( tfind_all_candidatesRRR9tversiont is_prereleasetmake_candidate_evaluatorR\tsort_best_candidatetNonetlinktis_wheelROtlatest_filetype(RQttyptall_candidatest candidatet evaluatortbest_candidatetremote_version(tfinderR3(sL/opt/alt/python36/lib/python3.6/site-packages/pip/_internal/commands/list.pyt latest_infoÊs"          (t_build_sessionR;RRd(R0RLR3R:RoRQ((RnR3sL/opt/alt/python36/lib/python3.6/site-packages/pip/_internal/commands/list.pyRNÅs  cC@sât|dd„ƒ}|jdkrR|rRt||ƒ\}}|j||ƒnŒ|jdkr¹xz|D]J}|jdkrœtd|j|j|jƒqhtd|j|jƒqhWn%|jdkrÞtt ||ƒƒndS( NRRcS@s |jjƒS(N(R\tlower(RQ((sL/opt/alt/python36/lib/python3.6/site-packages/pip/_internal/commands/list.pytìsR R"is %s==%s (%s)s%s==%sR#( tsortedRtformat_for_columnstoutput_package_listing_columnstverboseR R\R`tlocationtformat_for_json(R0RLR3tdatatheaderRQ((sL/opt/alt/python36/lib/python3.6/site-packages/pip/_internal/commands/list.pyRJès   cC@st|ƒdkr%|jd|ƒnt|ƒ\}}t|ƒdkrq|jddjtd„|ƒƒƒnx|D]}t|ƒqxWdS(Niit cS@sd|S(Nt-((tx((sL/opt/alt/python36/lib/python3.6/site-packages/pip/_internal/commands/list.pyRrs(tlentinsertR tjointmapR (R0RyRzt pkg_stringstsizestval((sL/opt/alt/python36/lib/python3.6/site-packages/pip/_internal/commands/list.pyRuûs( (t__name__t __module__t__doc__R+tignore_require_venvtusageR2R;RMRHRIRGRNRJRu(((sL/opt/alt/python36/lib/python3.6/site-packages/pip/_internal/commands/list.pyR#s M     # cC@s@|j}|r$ddddg}n ddg}g}|jdks[td„|Dƒƒrk|jdƒn|jdkrŠ|jdƒnx©|D]¡}|j|jg}|rÒ|j|jƒ|j|jƒn|jdksít|ƒr|j|j ƒn|jdkr%|jt |ƒƒn|j|ƒq‘W||fS( s_ Convert the package data into something usable by output_package_listing_columns. tPackagetVersiontLatesttTypeics@s|]}t|ƒVqdS(N(R (RSR}((sL/opt/alt/python36/lib/python3.6/site-packages/pip/_internal/commands/list.pys stLocationt Installer( RARvtanytappendR\R`RORgR RwR (tpkgsR3trunning_outdatedRzRytprojtrow((sL/opt/alt/python36/lib/python3.6/site-packages/pip/_internal/commands/list.pyRt s(  % cC@s²g}xœ|D]”}i|jd6tj|jƒd6}|jdkre|j|ds.  ""è &