๓
ฉ9Vc           @@  s  d  d l  m Z d  d l Z d  d l Z d  d l Z d  d l m Z d  d l m Z d  d l	 m
 Z
 m Z d  d l m Z d  d l m Z m Z d  d l m Z d  d	 l m Z d  d
 l m Z m Z d  d l m Z e j j e e j  d  Z e j e  Z  d e f d     YZ! d S(   i    (   t   absolute_importN(   t   RequirementCommand(   t   PackageFinder(   t   CommandErrort   PreviousBuildDirError(   t   RequirementSet(   t   import_or_raiset   normalize_path(   t   BuildDirectory(   t   RemovedInPip8Warning(   t
   WheelCachet   WheelBuilder(   t
   cmdoptionst
   wheelhouset   WheelCommandc           B@  s;   e  Z d  Z d Z d Z d Z d   Z d   Z d   Z RS(   sด  
    Build Wheel archives for your requirements and dependencies.

    Wheel is a built-package format, and offers the advantage of not
    recompiling your software during every install. For more details, see the
    wheel docs: http://wheel.readthedocs.org/en/latest.

    Requirements: setuptools>=0.8, and wheel.

    'pip wheel' uses the bdist_wheel setuptools extension from the wheel
    package to build individual wheels.

    t   wheels๕   
      %prog [options] <requirement specifier> ...
      %prog [options] -r <requirements file> ...
      %prog [options] [-e] <vcs project url> ...
      %prog [options] [-e] <local project path> ...
      %prog [options] <archive url/path> ...s$   Build wheels from your requirements.c         O@  sู  t  t |   j | |   |  j } | j d d d d d d d t d d	 | j t j    | j t j    | j t j	    | j t j
    | j d
 d d d d d d d d | j t j    | j t j    | j t j    | j t j    | j t j    | j t j    | j t j    | j d d d d d d d d d | j d d d d t d d | j t j    t j t j |  j  } |  j j d |  |  j j d |  d  S(   Ns   -ws   --wheel-dirt   destt	   wheel_dirt   metavart   dirt   defaultt   helpsA   Build wheels into <dir>, where the default is '<cwd>/wheelhouse'.s   --build-optiont   build_optionst   optionst   actiont   appends9   Extra arguments to be supplied to 'setup.py bdist_wheel'.s   --global-optiont   global_optionssZ   Extra global options to be supplied to the setup.py call before the 'bdist_wheel' command.s   --pret
   store_truesY   Include pre-release and development versions. By default, pip only finds stable versions.i    (   t   superR   t   __init__t   cmd_optst
   add_optiont   DEFAULT_WHEEL_DIRR   t	   use_wheelt   no_use_wheelt	   no_binaryt   only_binaryt   constraintst   editablet   requirementst   download_cachet   srct   no_depst	   build_dirt   Falset   no_cleant   make_option_groupt   index_groupt   parsert   insert_option_group(   t   selft   argst   kwR   t
   index_opts(    (    s/   /tmp/pip-build-5Z5nTX/pip/pip/commands/wheel.pyR   1   sT    		c         C@  sD   t  d t d  t  d t d  } t | d  s@ t d   n  d  S(   Ns   wheel.bdist_wheelsM   'pip wheel' requires the 'wheel' package. To fix this, run: pip install wheelt   pkg_resourcessp   'pip wheel' requires setuptools >= 0.8 for dist-info support. To fix this, run: pip install --upgrade setuptoolst   DistInfoDistribution(   R   R   t   hasattr(   R2   R6   (    (    s/   /tmp/pip-build-5Z5nTX/pip/pip/commands/wheel.pyt   check_required_packagesj   s    	c         C@  se  |  j    t j |  t j |  | j g | j } | j rb t j d d j	 |   g  } n  | j
 r~ t j d t  n  | j rข t j j | j  | _ n  |  j |  ฎ} t d | j d | j d | d | j d | j d	 | j d
 | j d | j d | j d |  
} | j p | j } t | j | j  } t | j d | } t  d | d | j! d d  d | j# d t$ d | j% d | d | d | j&  	}	 |  j' |	 | | | | |  j( |  |	 j) sหd  Szp yL t* |	 | d | j+ p้g  d | j, p๘g  }
 |
 j-   st. d   n  Wn t/ k
 r9t$ | _   n XWd  | j sT|	 j0   n  XWd  QXWd  QXd  S(   Ns   Ignoring indexes: %st   ,s|   --download-cache has been deprecated and will be removed in the future. Pip now automatically uses and configures its cache.t
   find_linkst   format_controlt
   index_urlst   allow_externalt   allow_unverifiedt   allow_all_externalt   allow_all_prereleasest   trusted_hostst   process_dependency_linkst   sessiont   deleteR+   t   src_dirt   download_dirt   ignore_dependenciest   ignore_installedt   isolatedt   wheel_cachet   wheel_download_dirR   R   s"   Failed to build one or more wheels(1   R9   R   t   resolve_wheel_no_use_binaryt   check_install_build_globalt	   index_urlt   extra_index_urlst   no_indext   loggert   infot   joinR(   t   warningst   warnR	   R+   t   ost   patht   abspatht   _build_sessionR   R;   R<   R>   R?   R@   t   preRB   RC   R-   R
   t	   cache_dirR   R   RF   t   NoneRH   t   Truet   isolated_modeR   t   populate_requirement_sett   namet   has_requirementsR   R   R   t   buildR   R   t   cleanup_files(   R2   R   R3   R=   RD   t   findert   build_deleteRK   R+   t   requirement_sett   wb(    (    s/   /tmp/pip-build-5Z5nTX/pip/pip/commands/wheel.pyt   run~   sv    
			
														 		(	   t   __name__t
   __module__t   __doc__Ra   t   usaget   summaryR   R9   Ri   (    (    (    s/   /tmp/pip-build-5Z5nTX/pip/pip/commands/wheel.pyR      s   	9	("   t
   __future__R    t   loggingRW   RU   t   pip.basecommandR   t	   pip.indexR   t   pip.exceptionsR   R   t   pip.reqR   t	   pip.utilsR   R   t   pip.utils.buildR   t   pip.utils.deprecationR	   t	   pip.wheelR
   R   t   pipR   RX   RT   t   curdirR    t	   getLoggerRj   RR   R   (    (    (    s/   /tmp/pip-build-5Z5nTX/pip/pip/commands/wheel.pyt   <module>   s   