a
    e0h                     @   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
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 d dlmZ d dlmZmZ erd 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)
WheelCache)
cmdoptions)RequirementCommandwith_cleanup)SUCCESS)CommandError)get_requirement_tracker)
ensure_dirnormalize_path)TempDirectory)MYPY_CHECK_RUNNING)buildshould_build_for_wheel_command)Values)List)InstallRequirementc                   @   s(   e Zd ZdZdZdd Zedd Zd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.

    z
      %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                 C   s  | j jddddtjdd | j t  | j t  | j t  | j jddd	d
dd | j t  | j t	  | j t
  | j t  | j t  | j t  | j t  | j t  | j t  | j t  | j t  | j jdddddd | j jddd
d	dd | j jddddd | j t  ttj| j}| jd| | jd| j  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--no-verify	no_verify
store_trueFz%Don't verify if built wheel is valid.)r   r   r   r   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--prezYInclude pre-release and development versions. By default, pip only finds stable versions.)r   r   r   r   )cmd_opts
add_optionoscurdirr   	no_binaryonly_binaryprefer_binaryno_build_isolation
use_pep517no_use_pep517constraintseditablerequirementssrcignore_requires_pythonno_deps	build_dirprogress_barrequire_hashesmake_option_groupindex_groupparserinsert_option_group)self
index_opts r:   J/var/www/auris/lib/python3.9/site-packages/pip/_internal/commands/wheel.pyadd_options3   sn    zWheelCommand.add_optionsc                 C   s  t | | |}| ||}t|j|j}t|j|_t	|j | 
t }t|j ddd}| ||||}| j||||||jdd}	| j|	||||j|jd}
| | |
j|dd}g }|j D ](}|jr|	| qt|r|| qt|||j |jpg |jpg d\}}|D ]~}|jr:|jjs>J |j sJJ zt!"|j |j W n@ t#y } z&t$%d	|j&| || W Y d }~n
d }~0 0 q$t'|d
krt(dt)S )NwheelT)deletekindglobally_managedF)temp_build_dirr   req_trackersessionfinderdownload_diruse_user_site)preparerrD   r   wheel_cacher/   r)   )check_supported_wheels)rH   verifyr   r    z Building wheel for %s failed: %sr   z"Failed to build one or more wheels)*r   check_install_build_globalget_default_session_build_package_finderr   	cache_dirformat_controlr   r   r
   enter_contextr	   r   no_cleanget_requirementsmake_requirement_preparermake_resolverr/   r)   trace_basic_inforesolver-   valuesis_wheelsave_linked_requirementr   r   r   r   r   r    linklocal_file_pathshutilcopyOSErrorloggerwarningnamelenr   r   )r8   r   argsrC   rD   rH   rB   	directoryreqsrG   resolverrequirement_setreqs_to_buildreqbuild_successesbuild_failureser:   r:   r;   runv   s~    



	



$zWheelCommand.runN)__name__
__module____qualname____doc__usager<   r   rm   r:   r:   r:   r;   r      s
   Cr   )&
__future__r   loggingr#   r\   pip._internal.cacher   Zpip._internal.clir   pip._internal.cli.req_commandr   r   pip._internal.cli.status_codesr   pip._internal.exceptionsr   pip._internal.req.req_trackerr	   pip._internal.utils.miscr
   r   pip._internal.utils.temp_dirr   pip._internal.utils.typingr   pip._internal.wheel_builderr   r   optparser   typingr   Zpip._internal.req.req_installr   	getLoggerrn   r_   r   r:   r:   r:   r;   <module>   s&   
