Current File : //lib/python3.9/site-packages/pip/_internal/commands/__pycache__/wheel.cpython-39.pyc
a

[��f�@s�ddlZddlZddlZddlmZddlmZddlmZddl	m
Z
ddlmZm
Z
ddlmZddlmZdd	lmZdd
lmZddlmZmZddlmZdd
lmZmZe�e�Z Gdd�de�Z!dS)�N)�Values)�List)�
WheelCache)�
cmdoptions)�RequirementCommand�with_cleanup)�SUCCESS)�CommandError)�InstallRequirement)�get_requirement_tracker)�
ensure_dir�normalize_path)�
TempDirectory)�build�should_build_for_wheel_commandc@s<eZdZdZdZdd�dd�Zeeee	e
d�dd	��ZdS)
�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> ...N)�returncCsv|jjddddtjdd�|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���|jjddd	d
dd�|j�t���|j�t���|jjd
d	d
dd�|j�t���t�tj|j�}|j�d|�|j�d|j�dS)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�actionrrz--prezYInclude pre-release and development versions. By default, pip only finds stable versions.)rrrr)Zcmd_optsZ
add_option�os�curdirrZ	no_binaryZonly_binaryZ
prefer_binaryZno_build_isolation�
use_pep517Z
no_use_pep517�constraintsZeditable�requirements�src�ignore_requires_pythonZno_depsZprogress_bar�
build_options�global_optionsZrequire_hashesZmake_option_groupZindex_group�parserZinsert_option_group)�selfZ
index_opts�r'�@/usr/lib/python3.9/site-packages/pip/_internal/commands/wheel.py�add_options+sV���
�zWheelCommand.add_options)�options�argsrcCs�t�|�|�|�}|�||�}t|j|j�}t|j�|_t	|j�|�
t��}t|j
ddd�}|�||||�}|j||||||jdd�}	|j|	||||j|jd�}
|�|�|
j|dd�}g}|j��D](}
|
jr�|	�|
�q�t|
�r�|�|
�q�t|||j|j�pg|j�pgd�\}}|D]~}
|
j�r:|
jj�s>J�|
j �sJJ�zt!�"|
j |j�Wn@t#�y�}z&t$�%d	|
j&|�|�|
�WYd}~n
d}~00�q$t'|�d
k�r�t(d��t)S)NZwheelT)�delete�kindZglobally_managedF)Ztemp_build_dirr*�req_tracker�session�finderZdownload_dirZ
use_user_site)�preparerr0r*�wheel_cacher"r)Zcheck_supported_wheels)r2Zverifyr#r$z Building wheel for %s failed: %srz"Failed to build one or more wheels)*rZcheck_install_build_globalZget_default_sessionZ_build_package_finderrZ	cache_dirZformat_controlr
rr�
enter_contextrrZno_cleanZget_requirementsZmake_requirement_preparerZ
make_resolverr"rZtrace_basic_info�resolver �valuesZis_wheelZsave_linked_requirementr�appendrrr#r$�linkZlocal_file_path�shutil�copy�OSError�loggerZwarning�name�lenr	r)r&r*r+r/r0r2r.Z	directoryZreqsr1ZresolverZrequirement_setZ
reqs_to_buildZreqZbuild_successesZbuild_failures�er'r'r(�runesx


��
�	


�
�$zWheelCommand.run)�__name__�
__module__�__qualname__�__doc__�usager)rrr�str�intr?r'r'r'r(rs
:r)"Zloggingrr8Zoptparser�typingrZpip._internal.cacherZpip._internal.clirZpip._internal.cli.req_commandrrZpip._internal.cli.status_codesrZpip._internal.exceptionsr	Zpip._internal.req.req_installr
Zpip._internal.req.req_trackerrZpip._internal.utils.miscrr
Zpip._internal.utils.temp_dirrZpip._internal.wheel_builderrrZ	getLoggerr@r;rr'r'r'r(�<module>s