B
    =)H[J  ã               @   sª   d dl mZ d dlZd dl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 d dlmZ d d	lmZ d d
lmZ d dlmZ e e¡ZG dd„ deƒZdS )é    )Úabsolute_importN)Ú
cmdoptions)ÚRequirementCommand)Ú
WheelCache)ÚCommandErrorÚPreviousBuildDirError)ÚRequirementPreparer)ÚRequirementSet)ÚResolver)ÚTempDirectory)ÚWheelBuilderc                   s4   e Zd ZdZdZdZdZ‡ f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� | t ¡ ¡ | t 	¡ ¡ |jddd	d
dd� | t 
¡ ¡ | t ¡ ¡ | t ¡ ¡ | t ¡ ¡ | t ¡ ¡ | t ¡ ¡ | t ¡ ¡ | t ¡ ¡ | t ¡ ¡ |jddd
d	dd� |jddddd� | t ¡ ¡ | t ¡ ¡ t tj| j¡}| j d|¡ | 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   Ú	no_binaryÚonly_binaryÚno_build_isolationÚconstraintsÚeditableÚrequirementsÚsrcÚignore_requires_pythonÚno_depsÚ	build_dirÚprogress_barÚno_cleanÚrequire_hashesÚmake_option_groupÚindex_groupÚparserÚinsert_option_group)ÚselfÚargsÚkwr   Ú
index_opts)Ú	__class__© ú]C:\Users\HIRONO~1\AppData\Local\Temp\pip-install-qz7kpjmn\pip\pip\_internal\commands\wheel.pyr   -   sV    zWheelCommand.__init__c             C   s¸  t  |¡ |jg|j }|jr4t dd |¡¡ g }|jrJt	j
 |j¡|_t	j
 |j¡|_|  |¡��H}|  ||¡}|jp~|j }t|j|jƒ}t|j|dd���}t|jd�}	zÔy°|  |	||||| j|¡ t|j
|jd |j|j|jd�}
t|
|||ddd|j|jd	|jd
�}|  |	¡ t!||
||j"�p*g |j#�p4g |jd�}|j$|	j% &¡ |d�}|�s`t'dƒ‚W n t(k
�r€   d	|_‚ Y nX W d |j�sž|	 )¡  | *¡  X W d Q R X W d Q R X d S )NzIgnoring indexes: %sú,r   )ÚdeleteÚkind)r-   )r*   Úsrc_dirÚdownload_dirÚwheel_download_dirr+   Úbuild_isolationFzto-satisfy-onlyT)ÚpreparerÚfinderÚsessionÚwheel_cacheÚuse_user_siteÚupgrade_strategyÚforce_reinstallÚignore_dependenciesr(   Úignore_installedÚisolated)r   r   r,   )rB   z"Failed to build one or more wheels)+r   Úcheck_install_build_globalÚ	index_urlÚextra_index_urlsÚno_indexÚloggerÚdebugÚjoinr*   r   ÚpathÚabspathr<   Ú_build_sessionÚ_build_package_finderr,   r   Ú	cache_dirÚformat_controlr   r	   r-   Úpopulate_requirement_setÚnamer   r   r+   r?   r
   rG   r(   Úisolated_modeÚresolver   r   r   Úbuildr&   Úvaluesr   r   Úcleanup_filesÚcleanup)r2   r   r3   Ú
index_urlsrB   rA   Úbuild_deleterC   Ú	directoryÚrequirement_setr@   ÚresolverÚwbÚwheels_built_successfullyr7   r7   r8   Úrunh   sr    










zWheelCommand.run)
Ú__name__Ú
__module__Ú__qualname__Ú__doc__rX   ÚusageÚsummaryr   rf   Ú__classcell__r7   r7   )r6   r8   r      s   ;r   )Ú
__future__r   Úloggingr   Úpip._internalr   Úpip._internal.basecommandr   Úpip._internal.cacher   Úpip._internal.exceptionsr   r   Ú pip._internal.operations.preparer   Zpip._internal.reqr	   Úpip._internal.resolver
   Úpip._internal.utils.temp_dirr   Úpip._internal.wheelr   Ú	getLoggerrg   rN   r   r7   r7   r7   r8   Ú<module>   s   
