Your IP : 216.73.216.213


Current Path : /opt/alt/python310/lib/python3.10/site-packages/wheel/__pycache__/
Upload File :
Current File : //opt/alt/python310/lib/python3.10/site-packages/wheel/__pycache__/bdist_wheel.cpython-310.pyc

o

��a�J�@srdZddlZddlZddlZddlZddlZddlZddlZddlm	Z	ddl
mZddlmZ
ddlmZddlmZddlmZdd	lmZdd
lmZmZddlZddlmZdd
lmZddlmZddlm Z ddl!m"Z"ddl#m$Z%ej&dkr�ddl'm(Z)nddl'm)Z)ej*Z*ej+Z+dZ,dd�Z-dd�Z.d'dd�Z/dd�Z0dd �Z1d!d"�Z2d#d$�Z3Gd%d&�d&e�Z4dS)(zI
Create a wheel (.whl) distribution.

A wheel is a built archive format.
�N)�OrderedDict)�Command)�log)�BytesIO)�iglob)�rmtree)�get_config_var)�ZIP_DEFLATED�
ZIP_STORED�)�write_pkg_info)�calculate_macosx_platform_tag)�pkginfo_to_metadata)�tags)�	WheelFile)�__version__��)�	Generator)�BytesGeneratorzcp3\dcCsd�tjd�S)Nzpy{}r)�format�sys�version_info�rr�D/opt/alt/python310/lib/python3.10/site-packages/wheel/bdist_wheel.py�
python_tag+�rcCs@tj��}|�d�r|durt||�}|dkrtjdkrd}|S)z0Return our platform name 'win32', 'linux_x86_64'�macosxN�linux_x86_64���
linux_i686)�	distutils�util�get_platform�
startswithr
r�maxsize)�archive_root�resultrrrr#/s

r#TcCs4t|�}|dur|rt�d�|�td�|S||kS)zfUse a fallback value for determining SOABI flags if the needed config
    var is unset or unavailable.Nz?Config variable '{0}' is unset, Python ABI tag may be incorrect�)r�warnings�warnr�RuntimeWarning)�var�fallback�expectedr*�valrrr�get_flag;s
�r0cCsNtd�}t��}|sd|dvrdttd�rdd}d}d}tdttd�|dkd�r'd	}td
|dk|dko4tjdkd�r>tjdkr>d}td
tjdkd|dkoMtjdkd�rWtjdkrWd}d|t��|||f}|S|rv|�	d�rvd|�
d�d}|S|r�|�	d�r�d�|�
d�dd��}|�dd��dd�}|S|r�|�dd��dd�}|Sd}|S)zXReturn the ABI tag based on SOABI (if available) or emulate SOABI
    (CPython 2, PyPy).�SOABI)�cp�pp�
maxunicode��Py_DEBUG�gettotalrefcountr2)r*�d�
WITH_PYMALLOC)r��mZPy_UNICODE_SIZEi���)rr)r.r*�uz
%s%s%s%s%szcpython-�-rzpypy-Nr(�.�_)
rr�interpreter_name�hasattrrr0rr4�interpreter_versionr$�split�join�replace)Zsoabi�implr8r;r=�abirrr�get_abi_tagGsP��
�
�	���rIcC�t|��dd�S�Nr>r@)�	safe_namerF)�namerrr�
safer_nameorrNcCrJrK)�safe_versionrF)�versionrrr�
safer_versionsrrQcCs*tt|d��t�|tj�||�dS)Nr)�print�str�os�chmod�stat�S_IWRITE)�func�path�excinforrr�remove_readonlywsr[c@s�eZdZdZedefdefg�Zdddded�fd	d
ddd
ddddd�	d�
e��fddde�fddg
Zgd�Z
dd�Zdd�Zedd��Zdd�Zd d!�Zd"ed#fd$d%�Zd&d'�Zed(d)��Zd*d+�ZdS),�bdist_wheelzcreate a wheel distributionZstored�deflated)z
bdist-dir=�bz1temporary directory for creating the distributionz
plat-name=�pz;platform name to embed in generated filenames (default: %s)N)�	keep-temp�kzPkeep the pseudo-installation tree around after creating the distribution archive)z	dist-dir=r8z-directory to put final built distributions in)�
skip-buildNz2skip rebuilding everything (for testing/debugging))�relativeNz7build the archive using relative paths (default: false))zowner=r=z@Owner name used when creating a tar file [default: current user])zgroup=�gzAGroup name used when creating a tar file [default: current group])�	universalNz'make a universal wheel (default: false)zcompression=z6zipfile compression (one of: {}) (default: 'deflated')z, zpython-tag=z7Python implementation compatibility tag (default: '%s'))z
build-number=NzqBuild number for this particular version. As specified in PEP-0427, this must start with a digit. [default: None])zpy-limited-api=Nz?Python tag (cp32|cp33|cpNN) for abi3 wheel tag (default: false))r`rbrcrecCsxd|_d|_d|_d|_d|_d|_d|_d|_d|_d|_	d|_
d|_d|_d|_
d|_t�|_d|_d|_d|_dS)N�zipFr])�	bdist_dir�data_dir�	plat_name�plat_tagr�	keep_temp�dist_dir�egginfo_dir�root_is_pure�
skip_buildrc�owner�groupre�compressionr�build_number�py_limited_api�plat_name_supplied)�selfrrr�initialize_options�s&
zbdist_wheel.initialize_optionscCs0|jdur|�d�j}tj�|d�|_|jd|_|jdu|_	z	|j
|j|_Wnty7t
d�|j���wd}|jdgt||��R�|j��pO|j��|_|jrbt�t|j�sbt
dt��|j�d�}d|vr�t�d�|dd	��}|��d
vr�d|_|jdur�|jdd	�� �s�t
d��dSdS)
N�bdist�wheelz.datazUnsupported compression: {})rlrirozpy-limited-api must match '%s'rez=The [wheel] section is deprecated. Use [bdist_wheel] instead.r)�1�true�yesTz1Build tag (build-number) must start with a digit.)!rg�get_finalized_command�
bdist_baserTrYrE�wheel_dist_namerhriru�supported_compressionsrr�KeyError�
ValueErrorr�set_undefined_optionsrf�distribution�has_ext_modules�has_c_librariesrnrt�re�match�PY_LIMITED_API_PATTERN�get_option_dict�loggerr*�strip�lowerrers�isdigit)rvr~Zneed_optionsryr/rrr�finalize_options�s8
��
�
�zbdist_wheel.finalize_optionscCs8t|j���t|j���f}|jr||jf7}d�|�S)z4Return distribution full name with - replaced with _r>)rNr��get_namerQ�get_versionrsrE)rv�
componentsrrrr�s�
zbdist_wheel.wheel_dist_namecs|jr|j�n#|jr
d�n|jr|j�d�s|j�nt|j���dvr*tjdkr*d�����	dd��	dd��|jrI|j
r?d	}n|j}|d
�f}|St�
�}t��}||}|jre||�d�re|j}d}ntt����}||�f}�fd
d�t��D�}||vs�Jd�|���|S)N�anyr)zlinux-x86_64rrr r>r@r?zpy2.py3ZnoneZcp3Zabi3csg|]	}|j|j�f�qSr)ZinterpreterrH)�.0�t�rirr�
<listcomp>s�z'bdist_wheel.get_tag.<locals>.<listcomp>z)would build wheel with unsupported tag {})rurirnr$r#rgrr%r�rFrerrrArCrtrSrIZsys_tagsr)rvrG�tagZ	impl_nameZimpl_ver�abi_tagZsupported_tagsrr�r�get_tag�s:

�

�zbdist_wheel.get_tagcCsX|�d�}d|_d|_|�d�}d|_|js|�d�|jddd�}|j|_d|_|j|_d|_	|�d	�}d|_
d
D]}t|d|tj
�|j|��q:d}tjd
krdtj
�tj
�|jd��}||_|_t||jrkdnd|�t�d|j�|�d�|��\}}}	d�|j|||	�}
|js�|j}ntj
�|j|�|j��}|�dd�d�t|j� ��t!|j�"���}tj
�|j|�}
|�#|j$|
�|�%|
�tj
�&|j'�s�t�(|j'�tj
�|j'|
d�}t)|d|j*��
}|�+|�Wd�n1s�wYt,|jdg��-ddjt.j/dd��|f�|j0�s(t�d|j�|j1�s*t2|jt3d�dSdSdS)N�
build_scripts�pythonT�	build_extF�build�install)�reinit_subcommands�install_scripts)�headers�scripts�data�purelib�platlib�install_r5�ntz..�install_purelib�install_platlibzinstalling to %sz{}-{}-{}-{}�install_egg_info)�targetrmz{}-{}.dist-infoz.whl�w�
dist_filesr\z{}.{}r(zremoving %s)�onerror)4�reinitialize_command�
executable�forceZinplacero�run_commandrg�root�compile�warn_dirZno_ep�setattrrTrYrErhrM�normpath�install_libbase�install_librnr��infor�rrrc�_ensure_relative�install_baser�rNr�r�rQr��egg2distrm�write_wheelfile�existsrl�makedirsrrrZwrite_files�getattr�appendrrrk�dry_runrr[)rvr�r�r�r��keyZbasedir_observed�impl_tagr�rjZarchive_basenamer&Zdistinfo_dirnameZdistinfo_dirZ
wheel_pathZwfrrr�run"s�


�
�
�

��
����zbdist_wheel.runz
bdist_wheel (�)cCs0ddlm}tjdkrt|t�s|�d�}|�}d|d<||d<t|j���|d<|j	dur3|j	|d	<|�
�\}}}|�d
�D]}|�d
�D]}	|�d
�D]}
d�||	|
f�|d<qMqFq?t
j�|d
�}t�d|�t�}t|dd��|�t|d��}
|
�|���dd��Wd�dS1s�wYdS)Nr)�Messagerzutf-8z1.0z
Wheel-VersionrzRoot-Is-Purelib�Buildr?r>ZTagZWHEELzcreating %s)�maxheaderlen�wbs
�
)�
email.messager�rr�
isinstancerS�encodernr�rsr�rDrErTrYr�r�rr�flatten�open�write�getvaluerF)rvZwheelfile_base�	generatorr��msgr�r�rjrGrH�platZwheelfile_path�buffer�frrrr�vs.


��"�zbdist_wheel.write_wheelfilecCs6tj�|�\}}|dd�tjkr||dd�}|S)Nrr)rTrY�
splitdrive�sep)rvrY�driverrrr��szbdist_wheel._ensure_relativecCs�|j�d�}t�}tdd�|�dd�d��D��}d|vr-t�dt�|�	|dd�d|vr7d|vr7d	}|D]+}t
|�D]$}|�d
�rMt�
d|�q?||vrctj�|�rct�d||�|�	|�q?q9|S)
N�metadatacSsh|]}|�qSrr)r��optionrrr�	<setcomp>�s�z,bdist_wheel.license_paths.<locals>.<setcomp>�
license_files)r5r5r�license_filezEThe "license_file" option is deprecated. Use "license_files" instead.)zLICEN[CS]E*zCOPYING*zNOTICE*zAUTHORS*�~z4ignoring license file "%s" as it looks like a backupz/adding license file "%s" (matched pattern "%s"))r�r��set�sorted�getrDr)r*�DeprecationWarning�addr�endswithr��debugrTrY�isfiler�)rvr��files�patterns�patternrYrrr�
license_paths�s.��

��	zbdist_wheel.license_pathscCshdd�}||�tj�|�s<ddl}tj�tj�|�d�}|�|�}d|f}|r8tj�|d�}|d|f7}t|��tj�|�rO|}	t	||�}
t�
|�n>tj�|d�}	t	||	�}
tj||d	d
�d�tj�|d�}t
|d
��}|����}
Wd�n1s�wY|
s�||�ttj�|d�|
�|jD]}tj�|�}t�|tj�||��q�||�dS)z:Convert an .egg-info directory into a .dist-info directorycSsPtj�|�rtj�|�stj�|�rt�|�dStj�|�r&t�|�dSdS)z-Appropriately delete directory, file or link.N)rTrYr��islink�isdir�shutilr�unlink)r_rrr�adios�s
$�z#bdist_wheel.egg2dist.<locals>.adiosrNz
*.egg-infoz)Egg metadata expected at %s but not foundz- (%s found - possible misnamed archive file?)�PKG-INFOcSshd�S)N>zrequires.txtr�zSOURCES.txtznot-zip-safer)�x�yrrr�<lambda>�sz&bdist_wheel.egg2dist.<locals>.<lambda>)�ignorezdependency_links.txt�r�METADATA)rTrYr��globrE�dirname�basenamer�r�r�mkdirr��copytreer��readr�rr��copy)rvZegginfo_pathZ
distinfo_pathr�r��pat�possible�errZaltZpkginfo_path�pkg_infoZdependency_links_pathZdependency_links_file�dependency_linksZlicense_path�filenamerrrr��s>



��
zbdist_wheel.egg2dist)�__name__�
__module__�__qualname__�descriptionrr
r	r�r#rrEr�user_options�boolean_optionsrwr��propertyrr�r��
wheel_versionr�r�r�r�rrrrr\}sV�������($
0T
r\)TT)5�__doc__r!rTr�rVrr�r)�collectionsr�distutils.corerrr��iorr�rr�	sysconfigr�zipfiler	r
�
pkg_resourcesZpkginforZmacosx_libfiler
r�rZvendored.packagingrZ	wheelfilerr5rrr�email.generatorrrrLrOr�rr#r0rIrNrQr[r\rrrr�<module>sJ

(