
§|j1  ã               @   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-5c7ija6t/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   