Current File : //usr/lib/python3/dist-packages/wheel/cli/__pycache__/convert.cpython-312.pyc
�

C�e�$���ddlmZddlZddlZddlZddlZddlZddlm	Z	ddl
m
Z
ddlmZddl
mZ	dd	lmZej&d
ej(�ZGd�de
�Zdd
�Zd�Zd�Zd�Zy#e$r	dd	lmZY�CwxYw)�)�annotationsN)�iglob�)�bdist_wheel)�	WheelFile�)�
WheelError)�Distributionz]
    (?P<name>.+?)-(?P<ver>.+?)
    (-(?P<pyver>py\d\.\d+)
     (-(?P<arch>.+?))?
    )?.egg$c��eZdZdZdZd�Zy)�_bdist_wheel_tagFNc�t�|jr|j�|jStj|�S)N)�full_tag_supplied�full_tagr�get_tag)�selfs �3/usr/lib/python3/dist-packages/wheel/cli/convert.pyrz_bdist_wheel_tag.get_tag&s/���!�!�d�m�m�&?��=�=� ��&�&�t�,�,�)�__name__�
__module__�__qualname__rrr�rrrrs�����H�-rrc�(�tjj|�}tj	|�}|std|����|j
�}tjd��}tjj|�r0tj|�5}|j|�ddd�n�tj|�D]�}tjj||�}tjj|�rtj ||��Ytj"|tjj||����|d}	|	r|	j%dd�x}	|d<|dxsdj%dd	�j%d
d	�}
|
dk7rd|	ddznd
}|ddu}|rt't)��}
nt+t)��}
||
_|	|
_d|
_|dxsd|
_|sd|
_|	||
f|
_tjj|dj8di|���}|
j;tjj|d�|�|
j=|d��dj8||
fi|��}t?tjj||�d�5}|jA|�ddd�tjB|�y#1swY���xYw#1swY�,xYw)NzInvalid egg file name: �_e2w��suffix�pyver�.��arch�any�_�-�cpr�noneTz{name}-{ver}.dist-infozEGG-INFO�	egg2wheel��	generatorz{name}-{ver}-{pyver}-{}-{}.whl�wr)"�os�path�basename�egg_info_re�matchr	�	groupdict�tempfile�mkdtemp�isfile�zipfile�ZipFile�
extractall�listdir�join�shutil�copy2�copytree�replacerr
r�root_is_pure�
python_tag�plat_name_supplied�	plat_namerr�format�egg2dist�write_wheelfiler�write_files�rmtree)�egg_path�dest_dir�filenamer-�egg_info�dir�egg�pth�srcrr�abi�root_is_purelib�bw�
dist_info_dir�
wheel_name�wfs                 rr%r%-s����w�w����)�H����h�'�E���2�8�*�=�>�>���� �H�
�
�
�&�
)�C�	�w�w�~�~�h��
�_�_�X�
&�	 �#��N�N�3��	 �	 ��:�:�h�'�	=�C��'�'�,�,�x��-�C��w�w�~�~�c�"����S�#�&�����R�W�W�\�\�#�s�%;�<�	=�
�W��E��$)�M�M�#�r�$:�:����!��V��%��.�.�s�C�8�@�@��c�J�D�#�e�m�$��q�r��
��C��v�&�$�.�O��
���
(��
�l�n�
-��%�B�O��B�M� �B���F�#�,�u�B�L��#����c�4�(����G�G�L�L��&E�&>�&E�&E�&Q��&Q�R�M��K�K������S�*�-�}�=����}���<�8�1�8�8��d�O�h�O�J�	�2�7�7�<�<��*�5�s�	;��r�
���s����M�M�#��S	 �	 ��L��s�K;�L�;L�Lc���d}|r&tj|�}|std|�d���|jd�\}}}|std|�d���|dd}|j	d�\}}}|r&|jd�r|}|j
dd	�}nd
}|j	d�\}}}	|std|�d���|r"|jd�}|jd�}|||	|d
�S)atExtract metadata from filenames.

    Extracts the 4 metadataitems needed (name, version, pyversion, arch) from
    the installer filename and the name of the egg-info directory embedded in
    the zipfile (if any).

    The egginfo filename has the format::

        name-ver(-pyver)(-arch).egg-info

    The installer filename has the format::

        name-ver.arch(-pyver).exe

    Some things to note:

    1. The installer filename is not definitive. An installer can be renamed
       and work perfectly well as an installer. So more reliable data should
       be used whenever possible.
    2. The egg-info data should be preferred for the name and version, because
       these come straight from the distutils metadata, and are mandatory.
    3. The pyver from the egg-info data should be ignored, as it is
       constructed from the version of Python used to build the installer,
       which is irrelevant - the installer filename is correct here (even to
       the point that when it's not there, any version is implied).
    4. The architecture must be taken from the installer filename, as it is
       not included in the egg-info data.
    5. Architecture-neutral installers still have an architecture because the
       installer format itself (being executable) is architecture-specific. We
       should therefore ignore the architecture if the content is pure-python.
    NzEgg info filename z
 is not validr"zInstaller filename ����pyrrzpy2.py3�name�ver)rUrVrr)r,�search�
ValueError�	partition�
rpartition�
startswithr:�group)
�wininfo_name�egginfo_name�egginfo�w_name�sep�rest�rest2�w_pyver�w_ver�w_archs
          r�parse_wininst_inforgcs��B�G���$�$�\�2����1�,��}�M�N�N�%�.�.�s�3��F�C����.�|�n�M�J�K�K����9�D��/�/�#�.��E�3��
�w�!�!�$�'����/�/�#�r�*��������-��E�3����.�|�n�M�J�K�K�����v�&���
�
�e�$���5�&�7�K�Krc���tj|�5}d}|j�D]
}d|vs�|}nttj
j
|�|�}d}|j�D]!}|jjd�s�d}n|rddi}nddi}djdi|��}	d	|	z}
g}d}|j�D]�}|jjd
d�\}}
|j�}|j|d�}|�|
|j�zd
z}|j}||
z}||_|j|=||j|<|r|j|�|r��|j!d�r|}��d|vs��|j#d
�\}}}��t%j&d
��}|j)||�ddd�d}d}|dxsdj+dd�j+dd�}rd}|dk7r|j+dd�}dj-	|||f�}|rt/t1��}nt3t1��}||_||_d|_|dxsd|_|sd|_|||f|_tj
j-d|	z�}|jAtj
j-|�|�|jC|d��tj
j-||�}tE|d�5}|jG|�ddd�tIjJ|�y#1swY���xYw#1swY�,xYw)Nz	.egg-infoT�PLATLIBF�purelibr�platlibz{name}-{ver}z%s.data/�/rz
.egg-info/�_b2wrr$rrr rr!r"rTr#z%s.dist-info�
wininst2wheelr&r(r)&r2r3�namelistrgr)r*r+�infolistrFr[r?�split�lower�get�
NameToInfo�append�endswithrZr/r0r4r:r6rr
rr;r<r=r>rrr@rArrBr7rC)r*rE�bdwr^rF�inforM�zipinfo�paths�	dist_info�datadir�members�keyr+�basepath�oldname�newnamerar!rHrLrrrPrNrO�
wheel_pathrQs                            rrnrn�sP��	����	�0%�#�������	�H��h�&�'���	�
"�"�'�'�"2�"2�4�"8�,�G�����|�|�~�	�G����*�*�9�5�"'���	����O�E���O�E�)�N�)�)�1�D�1�	��y�(�������|�|�~�	C�G�#�,�,�2�2�3��:�M�C���)�)�+�C��y�y��d�+�H���"�S�Y�Y�[�0�3�6���&�&�G���)�G�&�G�����w�'�&-�C�N�N�7�#�����w�'���#�#�K�0�#*�L�!�W�,�+2�+=�+=�c�+B�(�L�#�q�'	C�(���f�-�����s�G�$�a0%�f�C���M�E���L�!�E�*�*�3��4�<�<�S�#�F�D�����u�}��
�
�d�D�)�����9�e�S�$�7�8�J��
���
(��
�l�n�
-��%�B�O��B�M� �B����<�(�5�B�L��#����c�4�(����G�G�L�L��n�y�&@�A�M��K�K������S�,�/��?����}���@������h�
�3�J�	�:�s�	#��r�
���s����M�M�#��m0%�0%��f��s0�M�AM�C M�1M�
?M�"M�M�M(c���|D]m}t|�D]]}tjj|�ddk(rt}nt
}|rt
|�d�d��|||�|s�St
d��_�oy)Nrz.eggz... T)�flush�OK)rr)r*�splitextr%rn�print)�filesrE�verbose�pat�	installer�convs      r�convertr�sr������s��	�I��w�w���	�*�1�-��7� ��$������4�(��5���H�%���d��	�r)rD�strrEr��return�None)�
__future__r�os.pathr)�rer7r/r2�globrr�	wheelfilerrr	�
setuptoolsr
�ImportError�distutils.dist�compile�VERBOSEr,rr%rgrnr�rrr�<module>r�s���"��	�
����%�!��,�'��b�j�j��
�J�J�
��
-�{�
-� 3�lDL�NW�t
��i�,�+�,�s�A0�0A>�=A>