
^Vh                 @   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 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 m Z d  d
 l m Z e j e  Z Gd d   d e  Z d S)    )absolute_importN)RequirementCommand)CommandErrorPreviousBuildDirError)RequirementSet)import_or_raise)BuildDirectory)RemovedInPip10Warning)
WheelCacheWheelBuilder)
cmdoptionsc                   sR   e  Z d  Z d Z d Z d Z d Z   f d d   Z d d   Z d	 d
   Z	   S)WheelCommanda  
    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.

    wheelz
      %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> ...z$Build wheels from your requirements.c                s  t  t |   j | |   |  j } | j d d d d d d d t j 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 d d d d d d d d d | j d d d d d d d | j t j    | j t j    t j t j |  j  } |  j j d |  |  j j d |  d  S)Nz-wz--wheel-dirdest	wheel_dirmetavardirdefaulthelpzLBuild wheels into <dir>, where the default is the current working directory.z--build-optionbuild_optionsoptionsactionappendz9Extra arguments to be supplied to 'setup.py bdist_wheel'.z--global-optionglobal_optionszZExtra global options to be supplied to the setup.py call before the 'bdist_wheel' command.z--pre
store_trueFzYInclude pre-release and development versions. By default, pip only finds stable versions.r   )superr   __init__cmd_opts
add_optionoscurdirr   	use_wheelno_use_wheel	no_binaryonly_binaryconstraintseditablerequirementssrcno_deps	build_dirno_cleanrequire_hashesmake_option_groupindex_groupparserinsert_option_group)selfargskwr   
index_opts)	__class__ 1/tmp/pip-build-9m6vxulb/pip/pip/commands/wheel.pyr   .   sT    			zWheelCommand.__init__c             C   sD   t  d t d  t  d t d  } t | d  s@ t d   n  d  S)Nzwheel.bdist_wheelzM'pip wheel' requires the 'wheel' package. To fix this, run: pip install wheelpkg_resourceszp'pip wheel' requires setuptools >= 0.8 for dist-info support. To fix this, run: pip install --upgrade setuptoolsDistInfoDistribution)r   r   hasattr)r1   r8   r6   r6   r7   check_required_packagesg   s    	z$WheelCommand.check_required_packagesc          #   C   s\  |  j    t j |  t j |  | j r@ t j d t  n  | j r\ t j d t  n  | j	 rx t j d t  n  | j
 g | j } | j r t j d d j |   g  } n  | j r t j j | j  | _ n  |  j |  m} |  j | |  } | j p| j } t | j | j  } t | j d | } t d | d | j d	 d  d
 | j d d d | j d | d | d | j d | j   
}	 |  j! |	 | | | | |  j" |  |	 j# sd  Szq yL t$ |	 | d | j% pg  d | j& pg  }
 |
 j'   st( d   n  Wn t) k
 r0d | _   Yn XWd  | j sK|	 j*   n  XWd  QXWd  QXd  S)Nz--allow-external has been deprecated and will be removed in the future. Due to changes in the repository protocol, it no longer has any effect.z--allow-all-external has been deprecated and will be removed in the future. Due to changes in the repository protocol, it no longer has any effect.z--allow-unverified has been deprecated and will be removed in the future. Due to changes in the repository protocol, it no longer has any effect.zIgnoring indexes: %s,deleter*   src_dirdownload_dirignore_dependenciesignore_installedTisolatedsessionwheel_cachewheel_download_dirr,   r   r   z"Failed to build one or more wheels)+r;   r   resolve_wheel_no_use_binarycheck_install_build_globalallow_externalwarningswarnr	   allow_all_externalallow_unverified	index_urlextra_index_urlsno_indexloggerinfojoinr*   r   pathabspath_build_session_build_package_finderr+   r
   	cache_dirformat_controlr   r   r>   r@   isolated_moder   r,   populate_requirement_setnamehas_requirementsr   r   r   buildr   r   cleanup_files)r1   r   r2   
index_urlsrC   finderbuild_deleterD   r*   requirement_setwbr6   r6   r7   run{   sr    
	
	
	
										zWheelCommand.run)
__name__
__module____qualname____doc__r[   usagesummaryr   r;   rd   r6   r6   )r5   r7   r      s   9r   )
__future__r   loggingr   rI   pip.basecommandr   pip.exceptionsr   r   pip.reqr   	pip.utilsr   pip.utils.buildr   Zpip.utils.deprecationr	   	pip.wheelr
   r   pipr   	getLoggerre   rP   r   r6   r6   r6   r7   <module>   s   