a
    h0                     @   s   d dl mZ d dlZd dlmZ d dlmZ d dlmZ d dl	m
Z
 d dlmZ d dlmZ d d	lmZ d d
lmZ d dlmZ h dZerd dlmZ d dlmZ G dd deZdS )    )absolute_importN)
WheelCache)
cmdoptions)Command)SUCCESS)FormatControl)freeze)stdlib_pkgs)
deprecated)MYPY_CHECK_RUNNING>   ZwheelZ
setuptoolsZpipzpkg-resourcesZ
distribute)Values)Listc                   @   s(   e Zd ZdZdZdZdd Zdd ZdS )	FreezeCommandzx
    Output installed packages in requirements format.

    packages are listed in a case-insensitive sorted order.
    z
      %prog [options])ext://sys.stderrr   c              	   C   s   | j jddddg ddd | j jdd	d
dg ddd | j jddddddd | j jdddddd | j t  | j jdddddtd | j jddddd | j t  | j	d| j  d S ) Nz-rz--requirementrequirementsappendfilez}Use the order in the given requirements file and its comments when generating output. This option can be used multiple times.)destactiondefaultmetavarhelpz-fz--find-links
find_linksZURLz<URL for finding packages, which will be added to the output.z-lz--locallocal
store_trueFzUIf in a virtualenv that has global access, do not output globally-installed packages.)r   r   r   r   z--useruserz,Only output packages installed in user-site.z--all
freeze_allz,Do not skip these packages in the output: {}z, )r   r   r   z--exclude-editableexclude_editablez%Exclude editable package from output.r   )
Zcmd_optsZ
add_optionr   Z	list_pathformatjoinDEV_PKGSZlist_excludeparserZinsert_option_group)self r#   ?/usr/lib/python3/dist-packages/pip/_internal/commands/freeze.pyadd_options!   s^    	zFreezeCommand.add_optionsc                 C   s   t t t }t|j|}tt}|js2|t |jrD||j t	
| |jrdtdd ddd t|j|j|j|j|j|j|||jd	}tf i |D ]}tj|d  qtS )Nz0--find-links option in pip freeze is deprecated.z21.2im#  )ZreplacementZgone_inZissue)	Zrequirementr   Z
local_onlyZ	user_onlypathsisolatedwheel_cacheskipr   
)r   setr   Z	cache_dirr	   r   updater    Zexcludesr   Zcheck_list_path_optionr   r
   dictr   r   r   pathZisolated_moder   r   sysstdoutwriter   )r"   ZoptionsargsZformat_controlr(   r)   Zfreeze_kwargsliner#   r#   r$   runQ   s:    

zFreezeCommand.runN)__name__
__module____qualname____doc__ZusageZlog_streamsr%   r4   r#   r#   r#   r$   r      s
   0r   )Z
__future__r   r/   Zpip._internal.cacher   Zpip._internal.clir   Zpip._internal.cli.base_commandr   Zpip._internal.cli.status_codesr   Z#pip._internal.models.format_controlr   Zpip._internal.operations.freezer   Zpip._internal.utils.compatr	   Zpip._internal.utils.deprecationr
   Zpip._internal.utils.typingr   r    Zoptparser   typingr   r   r#   r#   r#   r$   <module>   s   