
}_1                 @   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: https://wheel.readthedocs.io/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 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ignore_requires_python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-3_sjtvrs/pip/pip/commands/wheel.pyr   .   sV    			zWheelCommand.__init__c             C   sA   t  d t d  t  d t d  } t | d  s= t d   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)r2   r9   r7   r7   r8   check_required_packagesh   s    	z$WheelCommand.check_required_packagesc          %   C   sj  |  j    t j |  t j |  | j r= t j d t  | j rV t j d t  | j	 ro t j d t  | j
 g | j } | j r t j d d j |   g  } | j r t j j | j  | _ t j j | j  | _ |  j |  q} |  j | |  } | j p| j } t | j | j  } t | j d | } t d | d | j d	 d  d
 | j d d d | j d | j d | d | d | j  d | j!  }	 |  j" |	 | | | | |  j# |  |	 j$ sd  Szn yI t% |	 | d | j& pg  d | j' p g  }
 |
 j(   st) d   Wn t* k
 r?d | _   Yn XWd  | j sW|	 j+   XWd  QRXWd  QRXd  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_installedTr)   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debugjoinr+   r   pathabspathr?   _build_session_build_package_finderr,   r
   	cache_dirformat_controlr   r   rA   r)   isolated_moder   r-   populate_requirement_setnamehas_requirementsr   r   r   buildr   r   cleanup_files)r2   r   r3   
index_urlsrD   finderbuild_deleterE   r+   requirement_setwbr7   r7   r8   run|   sv    
													zWheelCommand.run)
__name__
__module____qualname____doc__r\   usagesummaryr   r<   re   r7   r7   )r6   r8   r      s   :r   )
__future__r   loggingr   rJ   pip.basecommandr   pip.exceptionsr   r   pip.reqr   	pip.utilsr   pip.utils.buildr   Zpip.utils.deprecationr	   	pip.wheelr
   r   pipr   	getLoggerrf   rQ   r   r7   r7   r7   r8   <module>   s   