�
���c� � �� � d Z ddlZddlZddlZddlZddlZddlmZ ddlm Z ddl
mZ ddlm
Z
ddlmZ ddlmZ dd lmZ G d
� de
� � Zded
efd�Zded
efd�Zd� Zd� ZdS )zD
Create a dist_info directory
As defined in the wheel specification
� N)�contextmanager)�cleandoc)�Path)�Command)�log)� packaging)�SetuptoolsDeprecationWarningc �\ � e Zd ZdZg d�ZddgZddiZd� Zd� Ze de
d efd
�� � Zd� Z
dS )
� dist_infozcreate a .dist-info directory))z egg-base=�ezjdirectory containing .egg-info directories (default: top of the source tree) DEPRECATED: use --output-dir.)zoutput-dir=�ozYdirectory inside of which the .dist-info will becreated (default: top of the source tree))�tag-date�dz0Add date stamp (e.g. 20050528) to version number)z
tag-build=�bz-Specify explicit tag to add to version number)�no-date�Dz"Don't include date stamp [default])�
keep-egg-infoNz,*TRANSITIONAL* will be removed in the futurer r r c �h � d | _ d | _ d | _ d | _ d | _ d | _ d| _ d S )NF)�egg_base�
output_dir�name�
dist_info_dir�tag_date� tag_build�
keep_egg_info)�selfs �>/usr/lib/python3/dist-packages/setuptools/command/dist_info.py�initialize_optionszdist_info.initialize_options( s; � ���
������ �!�����
����"����� c �� � | j r/d}t j |t � � | j p| j | _ | j }|j pt j }t | j p|� � | _ | �
d� � }t | j � � |_ | j r
| j |_ n|j | _ | j
r
| j
|_
n|j
| _
|� � � || _ t! |� � � � � }t% |� � � � � }|� d|� �| _ t j � | j | j � d�� � | _ d S )NzA--egg-base is deprecated for dist_info command. Use --output-dir.�egg_info�-z
.dist-info)r �warnings�warnr r �distribution�src_root�os�curdirr �reinitialize_command�strr r �finalize_optionsr! �_safe�get_name�_version�get_versionr �path�joinr )r �msg�dist�project_dirr! r �versions r r+ zdist_info.finalize_options1 sN � ��=� ?�U�C��M�#�;�<�<�<�"�m�>�t��D�O�� ���m�0�r�y���t��=�+�>�>����,�,�Z�8�8�����0�0����=� .� $�
�H���$�-�D�M��>� 0�!%��H���%�/�D�N��!�!�#�#�#� ��
��T�]�]�_�_�%�%���4�+�+�-�-�.�.���'�'�g�'�'�� ��W�\�\�$�/�d�i�;S�;S�;S�T�T����r �dir_path�requires_bkpc # � K � |r�|� d�}t |d�� � t ||dd�� � d V � t |d�� � t j ||� � d S # t |d�� � t j ||� � w xY wd V � d S )Nz.__bkp__T)�
ignore_errors)�
dirs_exist_ok�symlinks)�_rm�_copy�shutil�move)r r6 r7 �bkp_names r �_maybe_bkp_dirzdist_info._maybe_bkp_dirP s� � � � ��
�"�,�,�,�H����-�-�-�-��(�H�D�4�H�H�H�H�
0������H�D�1�1�1�1���H�h�/�/�/�/�/�� �H�D�1�1�1�1���H�h�/�/�/�/�����E�E�E�E�Es �A �(Bc �4 � | j � dd�� � | j � � � | j j }t j � |� � s
J d� � �t j d� t j �
| j � � � � � � | � d� � }| �
|| j � � 5 |� || j � � d d d � � d S # 1 swxY w Y d S )NT)�parents�exist_okz&.egg-info dir should have been createdz
creating '{}'�bdist_wheel)r �mkdirr! �runr' |