a
    b3j                     @   s   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 d d	lmZ d d
lmZmZ d dlmZ d dlmZ e eZG dd de
ZdS )    N)Values)
WheelCache)
cmdoptions)RequirementCommandwith_cleanup)SUCCESS)CommandError)get_build_tracker)InstallRequirement)
ensure_dirnormalize_path)TempDirectory)buildc                   @   s<   e Zd ZdZdZddddZeeee	 e
d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/

    '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> ...N)returnc                 C   s`  | j jddddtj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 t  | j jddd	d
dd | j t  | j t  ttj| j}ttj| j}| jd| | 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--no-verify	no_verify
store_trueFz%Don't verify if built wheel is valid.)r   actionr   r   r   )cmd_opts
add_optionoscurdirr   no_build_isolation
use_pep517Zcheck_build_depsconstraintsZbuild_constraintseditablerequirementsZrequirements_from_scriptssrcignore_requires_pythonno_depsprogress_barconfig_settingsrequire_hashesmake_option_groupindex_groupparserZpackage_selection_groupinsert_option_group)self
index_optsZselection_opts r/   y/www/wwwroot/dpstar/app/297b3aabda72fedb274352021c2dd8b5_venv/lib/python3.9/site-packages/pip/_internal/commands/wheel.pyadd_options*   sP    zWheelCommand.add_options)optionsargsr   c                 C   s  t | t | | |}| ||}t|j|_t|j | t	 }t
|j ddd}| ||||}t|j}| j||||||jd| jd}	| j|	||||jd}
| | |
j|dd}|	|j  g }|j D ] }|jr|	| q|| qt|||j d\}}|D ]~}|jr4|jjs8J |jsDJ 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_dirr2   build_trackersessionfinderdownload_diruse_user_site	verbosity)preparerr;   r2   wheel_cacher$   )check_supported_wheels)r@   verifyz Building wheel for %s failed: %sr   z"Failed to build one or more wheels)(r   Zcheck_build_constraintsZcheck_release_control_exclusiveget_default_session_build_package_finderr   r   r   enter_contextr	   r   no_cleanget_requirementsr   	cache_dirmake_requirement_preparerr>   make_resolverr$   trace_basic_inforesolve prepare_linked_requirements_morer"   valuesis_wheelsave_linked_requirementappendr   r   linklocal_file_pathshutilcopyOSErrorloggerwarningnamelenr   r   )r-   r2   r3   r:   r;   r9   	directoryreqsr@   r?   resolverrequirement_setreqs_to_buildreqbuild_successesbuild_failureser/   r/   r0   run]   sv    






$zWheelCommand.run)__name__
__module____qualname____doc__usager1   r   r   liststrintrd   r/   r/   r/   r0   r      s
   3r   )loggingr   rT   optparser   pip._internal.cacher   pip._internal.clir   pip._internal.cli.req_commandr   r   pip._internal.cli.status_codesr   pip._internal.exceptionsr   Z,pip._internal.operations.build.build_trackerr	   Zpip._internal.req.req_installr
   pip._internal.utils.miscr   r   pip._internal.utils.temp_dirr   pip._internal.wheel_builderr   	getLoggerre   rW   r   r/   r/   r/   r0   <module>   s   
