
0c@_|                 @   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 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)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   s;  |  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 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_PKGSparserinsert_option_group)self r)   </tmp/pip-build-jynh7p1z/pip/pip/_internal/commands/freeze.pyadd_options    sN    									zFreezeCommand.add_optionsc             C   s   t  t   t    } t | j |  } t t  } | j sI | j t  t j	 |  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)Nrequirementr   
local_only	user_onlypathsisolatedwheel_cacheskipr    
)r   setr   	cache_dirr	   r   updater%   r   Zcheck_list_path_optiondictr   r   r   r   pathisolated_moder    r   sysstdoutwriter   )r(   optionsargsformat_controlr1   r2   freeze_kwargsliner)   r)   r*   runO   s&    							zFreezeCommand.runN)r   r   )__name__
__module____qualname____doc__usagelog_streamsr+   rB   r)   r)   r)   r*   r      s
   /r   )
__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.typingr
   r%   optparser   Ztypingr   r   r)   r)   r)   r*   <module>   s   