a
    |Ä#dä  ã                   @   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
 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mZ d dlmZ d dlmZmZ d dlmZ d dlm Z m!Z! e  "e#¡Z$G dd„ deƒZ%dS )é    N)ÚValues)ÚList)Ú
WheelCache)Ú
cmdoptions)ÚRequirementCommandÚwith_cleanup)ÚSUCCESS)ÚCommandError)Úget_build_tracker)ÚInstallRequirementÚLegacySetupPyOptionsCheckModeÚcheck_legacy_setup_py_options)Ú
deprecated)Ú
ensure_dirÚnormalize_path)ÚTempDirectory)ÚbuildÚshould_build_for_wheel_commandc                   @   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  t ¡ ¡ | j  t ¡ ¡ | j jddd	d
dd� | j  t ¡ ¡ | j  t ¡ ¡ | j  t ¡ ¡ | 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--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_opts© r;   úS/var/www/html/gsl.tools/lib/python3.9/site-packages/pip/_internal/commands/wheel.pyÚadd_options.   sZ    ùûû
þzWheelCommand.add_options)ÚoptionsÚargsr   c                 C   s
  |   |¡}|  ||¡}t|j|jƒ}t|jƒ|_t|jƒ |  t	ƒ ¡}t
|j ddd�}|  ||||¡}t||tjƒ d|jv rŒt|jƒ}n(|jjr¦tdddddd	� t|j|jƒ}| j||||||jd
| jd�}	| j|	||||j|jd�}
|  |¡ |
j|dd�}g }|j ¡ D ].}|j�r*|	 |¡ nt|ƒ�r| |¡ �qt |||j! |j"�pXg |j#�pbg d�\}}|D ]~}|j$�r†|j$j�sŠJ ‚|j%�s–J ‚zt& '|j%|j¡ W n@ t(�yê } z&t) *d|j+|¡ | |¡ W Y d }~n
d }~0 0 �qpt,|ƒdk�rt-dƒ‚t.S )NÚwheelT)ÚdeleteÚkindÚglobally_managedzno-binary-enable-wheel-cachezŒ--no-binary currently disables reading from the cache of locally built wheels. In the future --no-binary will not influence the wheel cache.z to use the --no-cache-dir optioni½,  z23.1)ÚreasonÚreplacementÚfeature_flagÚissueÚgone_inF)Útemp_build_dirr>   Úbuild_trackerÚsessionÚfinderÚdownload_dirÚuse_user_siteÚ	verbosity)ÚpreparerrL   r>   Úwheel_cacher.   r'   )Úcheck_supported_wheels)rQ   Úverifyr2   r3   z Building wheel for %s failed: %sr   z"Failed to build one or more wheels)/Úget_default_sessionÚ_build_package_finderr   Ú	cache_dirÚformat_controlr   r   r   Úenter_contextr
   r   Úno_cleanÚget_requirementsr   r   ÚWHEELÚfeatures_enabledr#   r   Úmake_requirement_preparerrO   Úmake_resolverr.   r'   Útrace_basic_infoÚresolver,   ÚvaluesÚis_wheelÚsave_linked_requirementr   Úappendr   r   r2   r3   ÚlinkÚlocal_file_pathÚshutilÚcopyÚOSErrorÚloggerÚwarningÚnameÚlenr	   r   )r9   r>   r?   rK   rL   rQ   rJ   Ú	directoryÚreqsrP   ÚresolverÚrequirement_setÚreqs_to_buildÚreqÚbuild_successesÚbuild_failuresÚer;   r;   r<   Úrunj   s”    

ýÿ
÷øú	



û
ý$zWheelCommand.run)Ú__name__Ú
__module__Ú__qualname__Ú__doc__Úusager=   r   r   r   ÚstrÚintrw   r;   r;   r;   r<   r      s
   <r   )&Úloggingr!   rg   Ú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
   Zpip._internal.req.req_installr   r   r   Úpip._internal.utils.deprecationr   Úpip._internal.utils.miscr   r   Úpip._internal.utils.temp_dirr   Úpip._internal.wheel_builderr   r   Ú	getLoggerrx   rj   r   r;   r;   r;   r<   Ú<module>   s"   
