JFIF$        dd7 

Viewing File: /usr/lib/python3.9/site-packages/pip/_internal/__pycache__/wheel_builder.cpython-39.pyc

a

[��f�/�@s�dZddlZddlZddlZddlZddlmZmZm	Z	m
Z
mZmZddl
mZmZddlmZmZddlmZddlmZmZddlmZmZdd	lmZdd
lmZddlm Z ddl!m"Z"dd
l#m$Z$ddl%m&Z&ddl'm(Z(ddl)m*Z*m+Z+m,Z,ddl-m.Z.ddl/m0Z0ddl1m2Z2ddl3m4Z4ddl5m6Z6e�7e8�Z9e�:dej;�Z<ee&ge=fZ>ee
e&e
e&fZ?e@e=d�dd�ZAe&e=e>e=d�dd�ZBe&e=d�dd�ZCe&e>e=d �d!d"�ZDe&ee=d�d#d$�ZEe&ee@d%�d&d'�ZFee=d(�d)d*�ZGe&e@dd+�d,d-�ZHe&e@e=e
e@e
e@e=ee@d.�d/d0�ZIe&e@e
e@e
e@e=ee@d1�d2d3�ZJe&e
e@e=d4�d5d6�ZKe	e&ee=e
e@e
e@e?d7�d8d9�ZLdS):z;Orchestrator for building wheels from InstallRequirements.
�N)�Any�Callable�Iterable�List�Optional�Tuple)�canonicalize_name�canonicalize_version)�InvalidVersion�Version)�
WheelCache)�InvalidWheelFilename�UnsupportedWheel)�FilesystemWheel�get_wheel_distribution)�Link)�Wheel)�build_wheel_pep517)�build_wheel_editable)�build_wheel_legacy)�InstallRequirement)�
indent_log)�
ensure_dir�	hash_file�is_wheel_installed)�make_setuptools_clean_args)�call_subprocess)�
TempDirectory)�path_to_url)�vcsz([a-z0-9_.]+)-([a-z0-9_.!+-]+))�s�returncCstt�|��S)zjDetermine whether the string looks like an egg_info.

    :param s: The string to parse. E.g. foo-2.1
    )�bool�_egg_info_re�search)r �r%�?/usr/lib/python3.9/site-packages/pip/_internal/wheel_builder.py�_contains_egg_info&sr')�req�
need_wheel�check_binary_allowedr!cCs�|jr
dS|jr&|r"t�d|j�dS|r.dS|js8dS|jrF|��S|jrPdS||�sjt�d|j�dSt	�s�t�d|j�dSdS)zBReturn whether an InstallRequirement should be built into a wheel.Fz(Skipping %s, due to already being wheel.TzCSkipping wheel build for %s, due to binaries being disabled for it.zOUsing legacy 'setup.py install' for %s, since package 'wheel' is not installed.)
Z
constraint�is_wheel�logger�info�name�
source_dir�editableZsupports_pyproject_editable�
use_pep517r)r(r)r*r%r%r&�
_should_build.s<���r2)r(r!cCst|dtd�S)NT�r)r*)r2�_always_true)r(r%r%r&�should_build_for_wheel_commandcsr5)r(r*r!cCst|d|d�S)NFr3)r2)r(r*r%r%r&� should_build_for_install_commandis�r6cCs�|js|jsdS|jrb|jjrb|jr(J�|js2J�t�|jj�}|sHJ�|�|jj|j�r^dSdS|jslJ�|j�	�\}}t
|�r�dSdS)z�
    Return whether a built InstallRequirement can be stored in the persistent
    wheel cache, assuming the wheel cache is available, and _should_build()
    has determined a wheel needs to be built.
    FT)r0r/�linkZis_vcsrZget_backend_for_scheme�schemeZis_immutable_rev_checkout�url�splitextr')r(Zvcs_backend�base�extr%r%r&�
_should_cachers


r=)r(�wheel_cacher!cCs>t|j�}|jsJ�|r.t|�r.|�|j�}n|�|j�}|S)zdReturn the persistent or temporary cache directory where the built
    wheel need to be stored.
    )r"�	cache_dirr7r=Zget_path_for_linkZget_ephem_path_for_link)r(r>Zcache_availabler?r%r%r&�_get_cache_dir�s

r@)�_r!cCsdS)NTr%)rAr%r%r&r4�sr4)r(�
wheel_pathr!c	Cs�t|jp
d�}ttj�|��}t|j�|kr>td�||j���tt	|�|�}t
|j�}t|�t|j�krztd�||j���|j
}|dur�td��zt|�}Wn$ty�d|��}t|��Yn0|td�kr�t|jt�s�td�|���dS)N�z7Wheel has unexpected file name: expected {!r}, got {!r}zMissing Metadata-VersionzInvalid Metadata-Version: z1.2z6Metadata 1.2 mandates PEP 440 version, but {!r} is not)rr.r�os�path�basenamer
�formatrr�str�versionr	�metadata_versionrrr
�
isinstance)	r(rBZcanonical_name�wZdistZdist_verstrZmetadata_version_valuerJ�msgr%r%r&�_verify_one�s<��
��
��rN)r(�
output_dir�verify�
build_options�global_optionsr0r!c	
Cs�|rdnd}zt|�Wn8tyP}z t�d||j|�WYd}~dSd}~00|j� t|||||�}Wd�n1s~0Y|r�|r�zt||�Wn<tt	fy�}z t�d||j|�WYd}~dSd}~00|S)zaBuild one wheel.

    :return: The filename of the built wheel, or None if the build failed.
    r0�wheelzBuilding %s for %s failed: %sNzBuilt %s for %s is invalid: %s)
r�OSErrorr,�warningr.Z	build_env�_build_one_inside_envrNr
r)	r(rOrPrQrRr0Zartifact�erBr%r%r&�
_build_one�s,�
�"rX)r(rOrQrRr0r!cCs�tdd���l}|jsJ�|jr�|js(J�|js2J�|rDt�d|j�|rVt�d|j�|rtt|j|j|j|jd�}q�t	|j|j|j|jd�}nt
|j|j|j|||jd�}|du�rVt
j�|�}t
j�||�}zPt|�\}	}
t�||�t�d|j||
|	���t�d|�|WWd�St�yT}zt�d	|j|�WYd}~n
d}~00|j�sht||�Wd�dS1�s�0YdS)
NrS)�kindz7Ignoring --global-option when building %s using PEP 517z6Ignoring --build-option when building %s using PEP 517)r.Zbackend�metadata_directory�tempd)r.�
setup_py_pathr/rRrQr[z3Created wheel for %s: filename=%s size=%d sha256=%szStored in directory: %sz Building wheel for %s failed: %s)rr.r1rZZpep517_backendr,rUrrErrr\Zunpacked_source_directoryrDrF�joinr�shutil�mover-Z	hexdigest�	Exception�_clean_one_legacy)r(rOrQrRr0Ztemp_dirrBZ
wheel_nameZ	dest_pathZ
wheel_hash�lengthrWr%r%r&rV�st


�����	
��
rV)r(rRr!cCsXt|j|d�}t�d|j�zt||jd�WdStyRt�d|j�YdS0dS)N)rRzRunning setup.py clean for %s)�cwdTz Failed cleaning build dir for %sF)	rr\r,r-r.rr/r`�error)r(rRZ
clean_argsr%r%r&ra1s�ra)�requirementsr>rPrQrRr!c
	Cs|sggfSt�dd�dd�|D���t���gg}}|D]p}|jsLJ�t||�}t||||||jol|j�}	|	r�t	t
|	��|_|jj|_
|jjs�J�|�|�q>|�|�q>Wd�n1s�0Y|r�t�dd�dd	�|D���|�rt�d
d�dd	�|D���||fS)z�Build wheels.

    :return: The list of InstallRequirement that succeeded to build and
        the list of InstallRequirement that failed to build.
    z*Building wheels for collected packages: %sz, css|]}|jVqdS)N�r.��.0r(r%r%r&�	<genexpr>R�zbuild.<locals>.<genexpr>NzSuccessfully built %s� cSsg|]
}|j�qSr%rfrgr%r%r&�
<listcomp>orjzbuild.<locals>.<listcomp>zFailed to build %scSsg|]
}|j�qSr%rfrgr%r%r&rltrj)r,r-r]rr.r@rXr0Zpermit_editable_wheelsrrr7Z	file_pathZlocal_file_pathr+�append)
rer>rPrQrRZbuild_successesZbuild_failuresr(r?Z
wheel_filer%r%r&�build@sH�



�
*��rn)M�__doc__ZloggingZos.pathrD�rer^�typingrrrrrrZpip._vendor.packaging.utilsrr	Zpip._vendor.packaging.versionr
rZpip._internal.cacherZpip._internal.exceptionsr
rZpip._internal.metadatarrZpip._internal.models.linkrZpip._internal.models.wheelrZ$pip._internal.operations.build.wheelrZ-pip._internal.operations.build.wheel_editablerZ+pip._internal.operations.build.wheel_legacyrZpip._internal.req.req_installrZpip._internal.utils.loggingrZpip._internal.utils.miscrrrZ$pip._internal.utils.setuptools_buildrZpip._internal.utils.subprocessrZpip._internal.utils.temp_dirrZpip._internal.utils.urlsrZpip._internal.vcsrZ	getLogger�__name__r,�compile�
IGNORECASEr#r"ZBinaryAllowedPredicateZBuildResultrHr'r2r5r6r=r@r4rNrXrVrarnr%r%r%r&�<module>s� 
	�6��
�!��'�G�
Back to Directory  nL+D550H?Mx ,D"v]qv;6*Zqn)ZP0!1 A "#a$2Qr D8 a Ri[f\mIykIw0cuFcRı?lO7к_f˓[C$殷WF<_W ԣsKcëIzyQy/_LKℂ;C",pFA:/]=H  ~,ls/9ć:[=/#f;)x{ٛEQ )~ =𘙲r*2~ a _V=' kumFD}KYYC)({ *g&f`툪ry`=^cJ.I](*`wq1dđ#̩͑0;H]u搂@:~וKL Nsh}OIR*8:2 !lDJVo(3=M(z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