JFIF$        dd7 

Viewing File: /usr/lib/python3.9/site-packages/pip/_internal/commands/__pycache__/list.cpython-39.opt-1.pyc

a

[��f�/�@sdddlZddlZddlmZddlmZmZmZmZm	Z	m
Z
mZddlm
Z
ddlmZddlmZddlmZddlmZdd	lmZdd
lmZddlmZmZddlmZdd
lm Z ddl!m"Z"ddl#m$Z$m%Z%ddl&m'Z'e�rddl(m)Z)Gdd�de�Z*e	e*Z+e�,e-�Z.Gdd�de�Z/dee
eee0ee0fd�dd�Z1dee0d�dd�Z2dS)�N)�Values)�
TYPE_CHECKING�Iterator�List�Optional�Sequence�Tuple�cast��canonicalize_name)�
cmdoptions)�IndexGroupCommand)�SUCCESS)�CommandError)�
LinkCollector)�
PackageFinder)�BaseDistribution�get_environment)�SelectionPreferences)�
PipSession)�stdlib_pkgs)�tabulate�write_output)�map_multithread)�DistributionVersionc@s"eZdZUdZeed<eed<dS)�_DistWithLatestInfoz�Give 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_version�latest_filetypeN)�__name__�
__module__�__qualname__�__doc__r�__annotations__�str�r$r$�?/usr/lib/python3.9/site-packages/pip/_internal/commands/list.pyrs
rc@s�eZdZdZdZdZdd�dd�Zeee	d�d	d
�Z
eeee
d�dd
�Zdedd�dd�Zdedd�dd�Zdedd�dd�Zdeedd�dd�Zdedd�dd�Zeeeeedd�dd�ZdS)�ListCommandzt
    List installed packages, including editables.

    Packages are listed in a case-insensitive sorted order.
    Tz
      %prog [options]N)�returncCs*|jjdddddd�|jjddddd	d�|jjd
ddddd�|jjd
ddddd�|jjdddddd�|j�t���|jjddddd�|jjddddddd�|jjddddd �|jjd!d"d#d$d �|jjd%dd#d&d'd(�|j�t���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.)�destr)r*r+z--prezYInclude pre-release and development versions. By default, pip only finds stable versions.z--format�store�list_format�columns)r0�freeze�jsonzBSelect the output format among: columns (default), freeze, or json)r)r-r*�choicesr+z--not-required�not_requiredz>List packages that are not dependencies of installed packages.)r)r-r+z--exclude-editable�store_false�include_editablez%Exclude editable package from output.z--include-editablez%Include editable package from output.T)r)r-r+r*r)	Zcmd_optsZ
add_optionrZ	list_pathZlist_excludeZmake_option_groupZindex_group�parserZinsert_option_group)�selfZ
index_optsr$r$r%�add_options3s�����
��
�	���zListCommand.add_options)�options�sessionr'cCs*tj||d�}td|jd�}tj||d�S)zK
        Create a package finder appropriate to this list command.
        )r:F)Zallow_yankedZallow_all_prereleases)�link_collector�selection_prefs)rZcreater�prer)r8r:r;r<r=r$r$r%�_build_package_finder�s��z!ListCommand._build_package_finder)r:�argsr'cCs�|jr|jrtd��t�|�tt�}|jrB|�dd�|jD��dd�t	|j
�j|j|j
|j|j|d�D�}|jr�|�||�}|jr�|�||�}n|jr�|�||�}|�||�tS)Nz5Options --outdated and --uptodate cannot be combined.css|]}t|�VqdS�Nr
)�.0�nr$r$r%�	<genexpr>��z"ListCommand.run.<locals>.<genexpr>cSsg|]}td|��qS)r)r	)rB�dr$r$r%�
<listcomp>�s�z#ListCommand.run.<locals>.<listcomp>)Z
local_onlyZ	user_onlyZeditables_onlyZinclude_editables�skip)�outdatedZuptodaterrZcheck_list_path_option�setrZexcludes�updater�pathZiter_installed_distributions�localr,�editabler6r4�get_not_required�get_outdated�get_uptodate�output_package_listingr)r8r:r@rH�packagesr$r$r%�run�s.

��zListCommand.run�_ProcessedDists�rSr:r'cCsdd�|�||�D�S)NcSsg|]}|j|jkr|�qSr$�r�version�rB�distr$r$r%rG�s�z,ListCommand.get_outdated.<locals>.<listcomp>��iter_packages_latest_infos�r8rSr:r$r$r%rP�s
�zListCommand.get_outdatedcCsdd�|�||�D�S)NcSsg|]}|j|jkr|�qSr$rWrYr$r$r%rG�s�z,ListCommand.get_uptodate.<locals>.<listcomp>r[r]r$r$r%rQ�s
�zListCommand.get_uptodatecs$dd�|D��t�fdd�|D��S)NcSs(h|] }|��pdD]}t|j��qqS)r$)Ziter_dependenciesr�name)rBrZZdepr$r$r%�	<setcomp>�s�z/ListCommand.get_not_required.<locals>.<setcomp>csh|]}|j�vr|�qSr$��canonical_name)rB�pkg�Zdep_keysr$r%r_�rE)�listr]r$rcr%rO�s�	zListCommand.get_not_requiredrc#sr|����T}|��|��dtdd���fdd�}t||�D]}|dur<|Vq<Wd�n1sd0YdS)Nr)rZr'csl��|j�}�js dd�|D�}�j|jd�}|�|�}|durDdS|j}|jjrXd}nd}||_||_	|S)NcSsg|]}|jjs|�qSr$)rXZ
is_prerelease)rB�	candidater$r$r%rG�s�zOListCommand.iter_packages_latest_infos.<locals>.latest_info.<locals>.<listcomp>)Zproject_nameZwheelZsdist)
Zfind_all_candidatesrar>Zmake_candidate_evaluatorZsort_best_candidaterX�linkZis_wheelrr)rZZall_candidatesZ	evaluatorZbest_candidateZremote_version�typ��finderr:r$r%�latest_info�s$��
z;ListCommand.iter_packages_latest_infos.<locals>.latest_info)Z_build_sessionr?rr)r8rSr:r;rjrZr$rhr%r\�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|jSrAr`)rZr$r$r%�<lambda>
rEz4ListCommand.output_package_listing.<locals>.<lambda>)�keyr0r1�z%s==%s (%s)z%s==%sr2)
�sortedr/�format_for_columns�output_package_listing_columns�verboser�raw_namerX�location�format_for_json)r8rSr:�data�headerrZr$r$r%rRs �

�
z"ListCommand.output_package_listing)rurvr'cCsbt|�dkr|�d|�t|�\}}t|�dkrL|�dd�tdd�|���|D]}t|�qPdS)Nrrm� cSsd|S)N�-r$)�xr$r$r%rk%rEz<ListCommand.output_package_listing_columns.<locals>.<lambda>)�len�insertr�join�mapr)r8rurvZpkg_stringsZsizes�valr$r$r%rpsz*ListCommand.output_package_listing_columns)rrr r!Zignore_require_venv�usager9rrrr?rr#�intrTrPrQrOrr\rRrpr$r$r$r%r&(s4V�%�
�
��'��r&rU)�pkgsr:r'cCs�ddg}|j}|r |�ddg�tdd�|D��}|r@|�d�|jdkrT|�d	�|jdkrh|�d
�g}|D]�}|jt|j�g}|r�|�t|j��|�|j	�|r�|�|j
p�d�|jdkr�|�|jp�d�|jdkr�|�|j�|�|�qp||fS)z_
    Convert the package data into something usable
    by output_package_listing_columns.
    ZPackageZVersionZLatest�Typecss|]}|jVqdSrA)rN)rBryr$r$r%rD8rEz%format_for_columns.<locals>.<genexpr>zEditable project locationrmZLocationZ	Installer�)
rI�extend�any�appendrqrrr#rXrr�editable_project_locationrs�	installer)r�r:rvZrunning_outdatedZ
has_editablesruZproj�rowr$r$r%ro+s2






rorVcCs�g}|D]r}|jt|j�d�}|jdkr@|jp0d|d<|j|d<|jr^t|j�|d<|j|d<|j	}|rp||d<|�
|�qt�|�S)	N)r^rXrmr�rsr�rrr�)
rrr#rXrqrsr�rIrrr�r�r2�dumps)rSr:rurZ�infor�r$r$r%rtXs �


rt)3r2ZloggingZoptparser�typingrrrrrrr	Zpip._vendor.packaging.utilsrZpip._internal.clirZpip._internal.cli.req_commandr
Zpip._internal.cli.status_codesrZpip._internal.exceptionsrZpip._internal.index.collectorrZ"pip._internal.index.package_finderrZpip._internal.metadatarrZ$pip._internal.models.selection_prefsrZpip._internal.network.sessionrZpip._internal.utils.compatrZpip._internal.utils.miscrrZpip._internal.utils.parallelrZpip._internal.metadata.baserrrUZ	getLoggerr�loggerr&r#rortr$r$r$r%�<module>s8$

�-
Back to Directory  nL+D550H?Mx ,D"v]qv;6*Zqn)ZP0!1 A "#a$2Qr D8 a Ri[f\mIykIw0cuFcRı?lO7к_f˓[C$殷WF<_W ԣsKcëIzyQy/_LKℂ;C",pFA:/]=H  ~,ls/9ć:[=/#f;)x{ٛE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