î
½1kdI  ã               @   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 m Z m Z d  d l m Z d  d	 l m Z d  d
 l m Z e j j e e j ƒ d ƒ Z Gd d „  d e ƒ Z d S)é    )Úabsolute_importN)ÚCommand)ÚPackageFinder)Úlogger)ÚCommandErrorÚPreviousBuildDirError)ÚInstallRequirementÚRequirementSetÚparse_requirements)Únormalize_path)ÚWheelBuilder)Ú
cmdoptionsZ
wheelhousec                   sF   e  Z d  Z d Z d Z d Z d Z ‡  f 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: http://wheel.readthedocs.org/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] <vcs project url> ...
      %prog [options] <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 d d	 ƒ| j t j j ƒ  ƒ | j t j	 j ƒ  ƒ | j d
 d d d d d d d d ƒ| j t j
 j ƒ  ƒ | j t j j ƒ  ƒ | j t j j ƒ  ƒ | j t j 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 |  j ƒ } |  j j d | ƒ |  j j d | ƒ d  S)Nz-wz--wheel-dirÚdestÚ	wheel_dirÚmetavarÚdirÚdefaultÚhelpzABuild wheels into <dir>, where the default is '<cwd>/wheelhouse'.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ÚDEFAULT_WHEEL_DIRr   Ú	use_wheelÚmakeÚno_use_wheelÚrequirementsÚdownload_cacheÚno_depsÚ	build_dirÚno_cleanÚmake_option_groupÚindex_groupÚparserÚinsert_option_group)ÚselfÚargsÚkwr   Ú
index_opts)Ú	__class__© úA/var/www/pythonscrapper/code/venv/build/pip/pip/commands/wheel.pyr   (   sF    		zWheelCommand.__init__c          $   C   s]  y d d  l  } Wn@ t k
 rR t j d% k  r8 d } n d } t d | ƒ ‚ Yn Xy d d  l } Wn t k
 rƒ t d ƒ ‚ Yn Xt | d ƒ s¢ t d ƒ ‚ n  | j g | j } | j	 rá t
 j d d	 j | ƒ ƒ g  } n  | j rý t
 j d
 d ƒ n  | j r&t
 j d
 d ƒ | | j 7} n  |  j | ƒ } t d | j d | d | j d | j d | j d | j d | j d | j d | ƒ 	} t j j | j ƒ | _ t d | j d d  d d  d | j d | j d d d | d | j  ƒ }	 t j j! | j  ƒ st j" | j  ƒ n  x' | D] }
 |	 j# t$ j% |
 d  ƒ ƒ qWxj | j& D]_ } xV t' | d | d | d | ƒD]6 } | j( r�t
 j d  | j) ƒ qgn  |	 j# | ƒ qgWqBW|	 j* sÙi |  j+ d! 6} d" | } t
 j, | ƒ d  Szf yA t- |	 | | j  d# | j. pýg  d$ | j/ pg  ƒ} | j0 ƒ  Wn t1 k
 r=d | _2 ‚  Yn XWd  | j2 sX|	 j3 ƒ  n  Xd  S)&Nr   é   zpython-wheelzpython3-wheelzS'pip wheel' requires the 'wheel' package. To fix this, run: sudo apt-get install %szp'pip wheel' requires setuptools >= 0.8 for dist-info support. To fix this, run: pip install --upgrade setuptoolsÚDistInfoDistributionzIgnoring indexes: %sú,z1.7zˆ--use-mirrors has been deprecated and will be removed in the future. Explicit uses of --index-url and/or --extra-index-url is suggested.z…--mirrors has been deprecated and will be removed in  the future. Explicit uses of --index-url and/or --extra-index-url is suggested.Ú
find_linksÚ
index_urlsr!   Úallow_externalÚallow_unverifiedÚallow_all_externalÚallow_all_prereleasesÚprocess_dependency_linksÚsessionr'   Úsrc_dirÚdownload_dirr%   Úignore_dependenciesÚignore_installedTÚwheel_download_dirÚfinderr   zignoring %sÚnamezLYou must give at least one requirement to %(name)s (see "pip help %(name)s")r   r   )r4   )4Úwheel.bdist_wheelÚImportErrorÚsysÚversion_infor   Úpkg_resourcesÚhasattrÚ	index_urlÚextra_index_urlsÚno_indexr   ÚnotifyÚjoinÚuse_mirrorsÚ
deprecatedÚmirrorsÚ_build_sessionr   r7   r!   r9   r:   r;   Úprer=   ÚosÚpathÚabspathr'   r	   r%   rA   r   ÚexistsÚmakedirsÚadd_requirementr   Ú	from_liner$   r
   ÚeditableÚurlÚhas_requirementsrE   Úerrorr   r   r   Úbuildr   r(   Úcleanup_files)r-   r   r.   r   Údebian_packagerJ   r8   r>   rD   Úrequirement_setrE   ÚfilenameÚreqÚoptsÚmsgÚwbr2   r2   r3   ÚrunU   s     					
																	zWheelCommand.run)	Ú__name__Ú
__module__Ú__qualname__Ú__doc__rE   ÚusageÚsummaryr   rj   r2   r2   )r1   r3   r      s   -r   )Ú
__future__r   rV   rH   Úpip.basecommandr   Ú	pip.indexr   Úpip.logr   Úpip.exceptionsr   r   Úpip.reqr   r	   r
   Úpip.utilr   Ú	pip.wheelr   Úpipr   rW   rP   Úcurdirr    r   r2   r2   r2   r3   Ú<module>   s   