
(h                 @   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 d d d d h Z e r d  d l m Z d  d l m Z Gd d   d e  Z d S)    )absolute_importN)
WheelCache)
cmdoptions)Command)SUCCESS)FormatControl)freeze)stdlib_pkgs)
deprecated)MYPY_CHECK_RUNNINGpip
setuptoolsZ
distributewheel)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.stderrc             C   sQ  |  j  j d d d d d d d g  d d	 d
 d |  j  j d d d d d d d g  d d d
 d |  j  j d d d d d d d d d
 d |  j  j d d d d d d d d
 d |  j  j t j    |  j  j d d d d d d
 d j d j t   |  j  j d d d d d d
 d  |  j  j t j    |  j j	 d! |  j   d  S)"Nz-rz--requirementdestrequirementsactionappenddefaultmetavarfilehelpz}Use the order in the given requirements file and its comments when generating output. This option can be used multiple times.z-fz--find-links
find_links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.z--useruserz,Only output packages installed in user-site.z--all
freeze_allz,Do not skip these packages in the output: {}z, z--exclude-editableexclude_editablez%Exclude editable package from output.r   )
cmd_opts
add_optionr   Z	list_pathformatjoinDEV_PKGSZlist_excludeparserinsert_option_group)self r*   </tmp/pip-build-kmztzv_d/pip/pip/_internal/commands/freeze.pyadd_options!   sP    									zFreezeCommand.add_optionsc             C   s  t  t   t    } t | j |  } t t  } | j sI | j t  | j rb | j | j  t	 j
 |  | j r t d d d  d d d d t d | j d | j d	 | j d
 | j d | j d | j d | d | d | j  	} x( t |   D] } t j j | d  q Wt S)Nz0--find-links option in pip freeze is deprecated.replacementZgone_inz21.2Zissueim#  requirementr   
local_only	user_onlypathsisolatedwheel_cacheskipr!   
)r   setr   	cache_dirr	   r    updater&   Zexcludesr   Zcheck_list_path_optionr   r
   dictr   r   r   pathisolated_moder!   r   sysstdoutwriter   )r)   optionsargsformat_controlr3   r4   freeze_kwargsliner*   r*   r+   runQ   s6    									zFreezeCommand.runN)r   r   )__name__
__module____qualname____doc__usagelog_streamsr,   rD   r*   r*   r*   r+   r      s
   0r   )
__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&   optparser   Ztypingr   r   r*   r*   r*   r+   <module>   s   