zmc
2023-10-12 ed135d79df12a2466b52dae1a82326941211dcc9
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
U
H=®d0,ã@s&ddlmZddlZddlZddlmZddlmZddlm    Z    ddl
m Z ddl m Z ddlmZdd    lmZdd
lmZdd lmZmZmZmZdd lmZdd lmZddlmZerøddlm Z ddl!m"Z"m#Z#m$Z$m%Z%ddl&m'Z'ddl(m)Z)e *e+¡Z,Gdd„de    ƒZ-dd„Z.dd„Z/dS)é)Úabsolute_importN)Úsix)Ú
cmdoptions)ÚIndexGroupCommand)ÚSUCCESS)Ú CommandError)Ú LinkCollector)Ú PackageFinder)ÚSelectionPreferences)Údist_is_editableÚget_installed_distributionsÚtabulateÚ write_output)Ú get_installer)Úmap_multithread)ÚMYPY_CHECK_RUNNING)ÚValues)ÚListÚSetÚTupleÚIterator)Ú
PipSession)Ú Distributionc@s`eZdZdZdZdZdd„Zdd„Zdd    „Zd
d „Z    d d „Z
dd„Z dd„Z dd„Z dd„ZdS)Ú ListCommandzt
    List installed packages, including editables.
 
    Packages are listed in a case-insensitive sorted order.
    Tz
      %prog [options]cCs|jjdddddd|jjddddd    d|jjd
d ddd d|jjd ddddd|jjdddddd|j t ¡¡|jjddddd|jjddddddd|jjddddd |jjd!d"d#d$d |jjd%dd#d&d'd(t tj|j¡}|j d)|¡|j d)|j¡dS)*Nz-oz
--outdatedÚ
store_trueFzList outdated packages)ÚactionÚdefaultÚhelpz-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--userÚuserz,Only output packages installed in user-site.)Údestrrrz--prezYInclude pre-release and development versions. By default, pip only finds stable versions.z--formatÚstoreÚ list_formatÚcolumns)r"ÚfreezeÚjsonzBSelect the output format among: columns (default), freeze, or json)rrrÚchoicesrz--not-requiredÚ not_requiredz>List packages that are not dependencies of installed packages.)rrrz--exclude-editableÚ store_falseÚinclude_editablez%Exclude editable package from output.z--include-editablez%Include editable package from output.T)rrrrr)Úcmd_optsÚ
add_optionrÚ    list_pathÚmake_option_groupÚ index_groupÚparserÚinsert_option_group)ÚselfÚ
index_opts©r2úRD:\z\workplace\VsCode\pyvenv\venv\Lib\site-packages\pip/_internal/commands/list.pyÚ add_options.s–üüüüûüú
üüûÿzListCommand.add_optionscCs*tj||d}td|jd}tj||dS)zK
        Create a package finder appropriate to this list command.
        )ÚoptionsF)Ú allow_yankedÚallow_all_prereleases)Úlink_collectorÚselection_prefs)rÚcreater
Úprer    )r0r5Úsessionr8r9r2r2r3Ú_build_package_finder{sþþz!ListCommand._build_package_findercCs‚|jr|jrtdƒ‚t |¡t|j|j|j|j    |j
d}|j rL|  ||¡}|jr`|  ||¡}n|jrr| ||¡}| ||¡tS)Nz5Options --outdated and --uptodate cannot be combined.)Ú
local_onlyÚ    user_onlyÚeditables_onlyÚinclude_editablesÚpaths)ÚoutdatedZuptodaterrÚcheck_list_path_optionr ÚlocalrÚeditabler(Úpathr&Úget_not_requiredÚ get_outdatedÚ get_uptodateÚoutput_package_listingr)r0r5ÚargsÚpackagesr2r2r3Úruns( ÿ
û    zListCommand.runcCsdd„| ||¡DƒS)NcSsg|]}|j|jkr|‘qSr2©Úlatest_versionÚparsed_version©Ú.0Údistr2r2r3Ú
<listcomp>®s ÿz,ListCommand.get_outdated.<locals>.<listcomp>©Úiter_packages_latest_infos©r0rMr5r2r2r3rI¬s
ÿzListCommand.get_outdatedcCsdd„| ||¡DƒS)NcSsg|]}|j|jkr|‘qSr2rOrRr2r2r3rUµs ÿz,ListCommand.get_uptodate.<locals>.<listcomp>rVrXr2r2r3rJ³s
ÿzListCommand.get_uptodatecs>tƒ‰|D]}ˆ dd„| ¡Dƒ¡q
t‡fdd„|DƒƒS)Ncss|] }|jVqdS©N©Úkey)rSÚ requirementr2r2r3Ú    <genexpr>¾sz/ListCommand.get_not_required.<locals>.<genexpr>csh|]}|jˆkr|’qSr2rZ)rSÚpkg©Zdep_keysr2r3Ú    <setcomp>Ãs
z/ListCommand.get_not_required.<locals>.<setcomp>)ÚsetÚupdateÚrequiresÚlist)r0rMr5rTr2r_r3rHºszListCommand.get_not_requiredc    #sR| ˆ¡>}| ˆ|¡‰‡‡fdd„}t||ƒD]}|dk    r0|Vq0W5QRXdS)Ncspd}ˆ |j¡}ˆjs$dd„|Dƒ}ˆj|jd}| |¡}|dkrHdS|j}|jjr\d}nd}||_    ||_
|S)NÚunknowncSsg|]}|jjs|‘qSr2)ÚversionÚ is_prerelease)rSÚ    candidater2r2r3rUÐsÿzOListCommand.iter_packages_latest_infos.<locals>.latest_info.<locals>.<listcomp>)Ú project_nameÚwheelÚsdist) Úfind_all_candidatesr[r;Úmake_candidate_evaluatorriÚsort_best_candidaterfÚlinkÚis_wheelrPÚlatest_filetype)rTÚtypZall_candidatesZ    evaluatorÚbest_candidateÚremote_version©Úfinderr5r2r3Ú latest_infoÊs" ÿ
z;ListCommand.iter_packages_latest_infos.<locals>.latest_info)Ú_build_sessionr=r)r0rMr5r<rwrTr2rur3rWÅs   z&ListCommand.iter_packages_latest_infoscCsœt|dd„d}|jdkr:|r:t||ƒ\}}| ||¡n^|jdkr€|D]4}|jdkrltd|j|j|jƒqHtd|j|jƒqHn|jd    kr˜tt    ||ƒƒdS)
NcSs
|j ¡SrY)riÚlower)rTr2r2r3Ú<lambda>ìóz4ListCommand.output_package_listing.<locals>.<lambda>rZr"r#éz %s==%s (%s)z%s==%sr$)
Úsortedr!Úformat_for_columnsÚoutput_package_listing_columnsÚverboserrirfÚlocationÚformat_for_json)r0rMr5ÚdataÚheaderrTr2r2r3rKès"þ
 
ÿ
z"ListCommand.output_package_listingcCsbt|ƒdkr| d|¡t|ƒ\}}t|ƒdkrL| dd tdd„|ƒ¡¡|D] }t|ƒqPdS)Nrr|ú cSsd|S)Nú-r2)Úxr2r2r3rzr{z<ListCommand.output_package_listing_columns.<locals>.<lambda>)ÚlenÚinsertr ÚjoinÚmapr)r0rƒr„Z pkg_stringsÚsizesÚvalr2r2r3rûs    z*ListCommand.output_package_listing_columnsN)Ú__name__Ú
__module__Ú __qualname__Ú__doc__Úignore_require_venvÚusager4r=rNrIrJrHrWrKrr2r2r2r3r#sM #rcCsØ|j}|rddddg}nddg}g}|jdks@tdd„|DƒƒrJ| d¡|jdkr^| d    ¡|D]l}|j|jg}|rŽ| |j¡| |j¡|jdks t|ƒr¬| |j    ¡|jdkrÄ| t
|ƒ¡| |¡qb||fS)
z_
    Convert the package data into something usable
    by output_package_listing_columns.
    ÚPackageÚVersionZLatestÚTyper|css|]}t|ƒVqdSrY)r )rSr‡r2r2r3r]sz%format_for_columns.<locals>.<genexpr>ZLocationZ    Installer) rCr€ÚanyÚappendrirfrPrqr rr)Úpkgsr5Zrunning_outdatedr„rƒZprojÚrowr2r2r3r~ s(
 
 
 
 r~cCsvg}|D]b}|jt |j¡dœ}|jdkr@|j|d<t|ƒ|d<|jr`t |j¡|d<|j    |d<| 
|¡qt   |¡S)N)Únamerfr|rÚ    installerrPrq) rirÚ    text_typerfr€rrrCrPrqr˜r$Údumps)rMr5rƒrTÚinfor2r2r3r‚1s
þ
 
 
 r‚)0Ú
__future__rr$ÚloggingÚ pip._vendorrZpip._internal.clirÚpip._internal.cli.req_commandrÚpip._internal.cli.status_codesrÚpip._internal.exceptionsrÚpip._internal.index.collectorrÚ"pip._internal.index.package_finderr    Ú$pip._internal.models.selection_prefsr
Úpip._internal.utils.miscr r r rÚpip._internal.utils.packagingrZpip._internal.utils.parallelrÚpip._internal.utils.typingrÚoptparserÚtypingrrrrÚpip._internal.network.sessionrZpip._vendor.pkg_resourcesrÚ    getLoggerrŽÚloggerrr~r‚r2r2r2r3Ú<module>s0               
i&