ó
'^c           @@  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 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 m Z d  d
 l m Z d  d l m Z d  d l m Z m Z e rd  d l m Z d  d l m Z m  Z  n  e j! e"  Z# d e
 f d     YZ$ d S(   i    (   t   absolute_importN(   t
   WheelCache(   t
   cmdoptions(   t   RequirementCommand(   t   CommandErrort   PreviousBuildDirError(   t   RequirementSet(   t   get_requirement_tracker(   t
   ensure_dirt   normalize_path(   t   TempDirectory(   t   MYPY_CHECK_RUNNING(   t   buildt   should_build_for_wheel_command(   t   Values(   t   Anyt   Listt   WheelCommandc           B@  s&   e  Z d  Z d Z d   Z d   Z RS(   s´  
    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.

    ső   
      %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> ...c         O@  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 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 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 t d d | j t j    | j t j    t j t j |  j  } |  j j d |  |  j j d |  d  S(   Ns   -ws   --wheel-dirt   destt	   wheel_dirt   metavart   dirt   defaultt   helpsL   Build wheels into <dir>, where the default is the current working directory.s   --build-optiont   build_optionst   optionst   actiont   appends9   Extra arguments to be supplied to 'setup.py bdist_wheel'.s   --global-optiont   global_optionssZ   Extra global options to be supplied to the setup.py call before the 'bdist_wheel' command.s   --pret
   store_truesY   Include pre-release and development versions. By default, pip only finds stable versions.i    (   t   superR   t   __init__t   cmd_optst
   add_optiont   ost   curdirR   t	   no_binaryt   only_binaryt   prefer_binaryt   no_build_isolationt
   use_pep517t   no_use_pep517t   constraintst   editablet   requirementst   srct   ignore_requires_pythont   no_depst	   build_dirt   progress_bart   Falset   no_cleant   require_hashest   make_option_groupt   index_groupt   parsert   insert_option_group(   t   selft   argst   kwR    t
   index_opts(    (    s9   /tmp/pip-build-eiI0Wo/pip/pip/_internal/commands/wheel.pyR   5   s\    			c         C@  sź  t  j |  |  j |  } |  j | |  } | j p= | j } t | j | j  } t	 | j
  | _
 t | j
  t   8} t | j d | d d } t   }	 zŕyź|  j |	 | | | | |  |  j d | d | d | d | d | d	 | j
 d
 t  }
 |  j d |
 d | d | d | d | j d | j  } |  j |  | j |	  g  |	 j j   D] } t |  rc| ^ qc} t | d | d | j pg  d | j pŤg  \ } } x | D] } | j rŮ| j j sßt  | j  sît  y t! j" | j  | j
  Wqžt# k
 r@} t$ j% d | j& |  | j' |  qžXqžWt( |  d k rft) d   n  Wn t* k
 rt+ | _   n XWd  | j sŤ|	 j,   | j-   n  XWd  QXWd  QXd  S(   Nt   deletet   kindt   wheelt   temp_build_dirR   t   req_trackert   sessiont   findert   wheel_download_dirt   use_user_sitet   preparert   wheel_cacheR.   R(   R   R   s    Building wheel for %s failed: %si    s"   Failed to build one or more wheels(.   R   t   check_install_build_globalt   get_default_sessiont   _build_package_finderR3   R0   R   t	   cache_dirt   format_controlR	   R   R   R   R
   R   t   populate_requirement_sett   make_requirement_preparerR2   t   make_resolverR.   R(   t   trace_basic_infot   resolveR,   t   valuesR   R   R   R   t   linkt   is_wheelt   AssertionErrort   local_file_patht   shutilt   copyt   OSErrort   loggert   warningt   nameR   t   lenR   R   t   Truet   cleanup_filest   cleanup(   R9   R   R:   RB   RC   t   build_deleteRG   RA   t	   directoryt   requirement_setRF   t   resolvert   rt   reqs_to_buildt   build_successest   build_failurest   reqt   e(    (    s9   /tmp/pip-build-eiI0Wo/pip/pip/_internal/commands/wheel.pyt   runs   sx     	 							
(   t   __name__t
   __module__t   __doc__t   usageR   Rk   (    (    (    s9   /tmp/pip-build-eiI0Wo/pip/pip/_internal/commands/wheel.pyR      s   	>(%   t
   __future__R    t   loggingR"   RW   t   pip._internal.cacheR   t   pip._internal.cliR   t   pip._internal.cli.req_commandR   t   pip._internal.exceptionsR   R   t   pip._internal.reqR   t   pip._internal.req.req_trackerR   t   pip._internal.utils.miscR   R	   t   pip._internal.utils.temp_dirR
   t   pip._internal.utils.typingR   t   pip._internal.wheel_builderR   R   t   optparseR   t   typingR   R   t	   getLoggerRl   RZ   R   (    (    (    s9   /tmp/pip-build-eiI0Wo/pip/pip/_internal/commands/wheel.pyt   <module>   s$   