
    )h                         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
 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mZ d dlmZ d dlmZ  e j<                  e      Z  G d de      Z!y)    N)Values)List)
WheelCache)
cmdoptions)RequirementCommandwith_cleanup)SUCCESS)CommandError)get_build_tracker)InstallRequirementcheck_legacy_setup_py_options)
ensure_dirnormalize_path)TempDirectory)buildc                   @    e Zd ZdZdZd	dZededee	   de
fd       Zy)
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/

    'pip wheel' uses the build system interface as described here:
    https://pip.pypa.io/en/stable/reference/build-system/

    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> ...returnNc                    | j                   j                  ddddt        j                  d       | j                   j                  t	        j
                                | j                   j                  t	        j                                | j                   j                  t	        j                                | j                   j                  t	        j                                | j                   j                  t	        j                                | j                   j                  t	        j                                | j                   j                  t	        j                                | j                   j                  t	        j                                | j                   j                  t	        j                                | j                   j                  t	        j                                | j                   j                  t	        j                                | j                   j                  t	        j                                 | j                   j                  t	        j"                                | j                   j                  t	        j$                                | j                   j                  ddd	d
d       | j                   j                  t	        j&                                | j                   j                  t	        j(                                | j                   j                  t	        j*                                | j                   j                  dd	d
d       | j                   j                  t	        j,                                t	        j.                  t        j0                  | j2                        }| j2                  j5                  d|       | j2                  j5                  d| j                          y )Nz-wz--wheel-dir	wheel_dirdirzLBuild wheels into <dir>, where the default is the current working directory.)destmetavardefaulthelpz--no-verify	no_verify
store_trueFz%Don't verify if built wheel is valid.)r   actionr   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check_build_depsconstraintseditablerequirementssrcignore_requires_pythonno_depsprogress_barconfig_settingsbuild_optionsglobal_optionsrequire_hashesmake_option_groupindex_groupparserinsert_option_group)self
index_optss     O/var/www/html/venv/lib/python3.12/site-packages/pip/_internal/commands/wheel.pyadd_optionszWheelCommand.add_options,   s     II- 	! 
	
 	  !5!5!78  !7!7!9:  !9!9!;<  !>!>!@A  !6!6!89  !9!9!;<  !<!<!>?  !7!7!9:  !4!4!67  !8!8!:;  !12  !B!B!DE  !3!3!56  !8!8!:;  8 	! 	
 	  !;!;!=>  !9!9!;<  !:!:!<=  2 	! 	
 	  !:!:!<=11""KK


 	'':6''4==9    optionsargsc           
      h   | j                  |      }| j                  ||      }t        |j                        |_        t	        |j                         | j                  t                     }t        |j                   dd      }| j                  ||||      }t        ||       t        |j                        }| j                  ||||||j                  d| j                        }	| j                  |	||||j                   |j"                        }
| j%                  |       |
j'                  |d      }g }|j(                  j+                         D ]1  }|j,                  r|	j/                  |       !|j1                  |       3 |	j3                  |j(                  j+                                t5        |||j6                   |j8                  xs g |j:                  xs g       \  }}|D ]_  }|j<                  r|j<                  j,                  sJ |j>                  sJ 	 tA        jB                  |j>                  |j                         a tM        |      d
k7  rtO        d      tP        S # tD        $ r<}tF        jI                  d	|jJ                  |       |j1                  |       Y d }~d }~ww xY w)NwheelT)deletekindglobally_managedF)temp_build_dirr>   build_trackersessionfinderdownload_diruse_user_site	verbosity)preparerrH   r>   wheel_cacher.   r'   )check_supported_wheels)rM   verifyr2   r3   z Building wheel for %s failed: %sr   z"Failed to build one or more wheels))get_default_session_build_package_finderr   r   r   enter_contextr   r   no_cleanget_requirementsr   r   	cache_dirmake_requirement_preparerrK   make_resolverr.   r'   trace_basic_inforesolver,   valuesis_wheelsave_linked_requirementappend prepare_linked_requirements_morer   r   r2   r3   linklocal_file_pathshutilcopyOSErrorloggerwarningnamelenr
   r	   )r9   r>   r?   rG   rH   rF   	directoryreqsrM   rL   resolverrequirement_setreqs_to_buildreqbuild_successesbuild_failureses                    r;   runzWheelCommand.rung   s   **73++GW=*7+<+<=7$$%**+<+>?!'''!
	 $$T7FGD%gt4 !2!2311$' **nn 2 	
 %%##*#A#A)) & 
 	f%"**4*M24"//668 	*C||005$$S)		* 	11/2N2N2U2U2WX +0#)))!//52"117R+
' # 	+C88 1 111&&&&+C//1B1BC	+ ~!#CDD  +6HH
 %%c**+s   !*I,,	J152J,,J1)r   N)__name__
__module____qualname____doc__usager<   r   r   r   strintrq    r=   r;   r   r      sF    
0E9:v N6 Nc Ns N Nr=   r   )"loggingr!   ra   optparser   typingr   pip._internal.cacher   pip._internal.clir   pip._internal.cli.req_commandr   r   pip._internal.cli.status_codesr	   pip._internal.exceptionsr
   ,pip._internal.operations.build.build_trackerr   pip._internal.req.req_installr   r   pip._internal.utils.miscr   r   pip._internal.utils.temp_dirr   pip._internal.wheel_builderr   	getLoggerrr   rd   r   ry   r=   r;   <module>r      sX     	    * ( J 2 1 J @ 6 -			8	$^% ^r=   