3
LY1                 @   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G dd deZdS )    )absolute_importN)RequirementCommand)CommandErrorPreviousBuildDirError)RequirementSet)import_or_raise)BuildDirectory)RemovedInPip10Warning)
WheelCacheWheelBuilder)
cmdoptionsc                   s<   e Zd ZdZdZdZdZ fddZdd Zd	d
 Z	  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                sP  t t| j|| | j}|j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 |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 |j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	wheel_dirdirzLBuild wheels into <dir>, where the default is the current working directory.)destmetavardefaulthelpz--build-optionbuild_optionsoptionsappendz9Extra arguments to be supplied to 'setup.py bdist_wheel'.)r   r   actionr   z--global-optionglobal_optionszZExtra global options to be supplied to the setup.py call before the 'bdist_wheel' command.)r   r   r   r   z--pre
store_trueFzYInclude pre-release and development versions. By default, pip only finds stable versions.)r   r   r   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__ e/private/var/folders/7d/20zwc49s3kn54d3vgq8bd4640000gn/T/pip-build-an2lx5zf/pip/pip/commands/wheel.pyr   .   sV    zWheelCommand.__init__c             C   s.   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   s  | j   tj| tj| |jr.tjdt |jr@tjdt |j	rRtjdt |j
g|j }|jr|tjddj| g }|jrtjj|j|_tjj|j|_| j|}| j||}|jp|j }t|j|j}t|j|d}t||jd |jd|j|j|||j |j!d}	| j"|	||||| j#| |	j$s6d S zZy6t%|	||j&pJg |j'pTg d	}
|
j( slt)d
W n t*k
r   d|_ Y nX W d |js|	j+  X W d Q R X W d Q R X d 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,)deleteT)r+   src_dirdownload_dirignore_dependenciesignore_installedr)   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   __classcell__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   
