File: //usr/local/lib/python3.7/site-packages/setuptools/command/__pycache__/dist_info.cpython-37.pyc
B
N��gc � @ s� d Z ddlZddlZddlZddlmZ ddlmZ ddlm Z ddl
mZ ddlm
Z
dd lmZ G d
d� de �Zdd
� Zdd� ZdS )zD
Create a dist_info directory
As defined in the wheel specification
� N)�contextmanager)�log)�Command)�Path� )�_normalization)�SetuptoolsDeprecationWarningc @ s` e Zd ZdZdZddddddgZd d
gZdd iZdd
� Zdd� Z e
eed�dd��Z
dd� ZdS )� dist_infoz�
This command is private and reserved for internal use of setuptools,
users should rely on ``setuptools.build_meta`` APIs.
z@DO NOT CALL DIRECTLY, INTERNAL ONLY: create .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))ztag-date�dz0Add date stamp (e.g. 20050528) to version number)z
tag-build=�bz-Specify explicit tag to add to version number)zno-date�Dz"Don't include date stamp [default])z
keep-egg-infoNz,*TRANSITIONAL* will be removed in the futureztag-datez
keep-egg-infozno-datec C s. 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)�self� r �@/tmp/pip-unpacked-wheel-yrlplx0q/setuptools/command/dist_info.py�initialize_options) s zdist_info.initialize_optionsc C s� | j r&d}tj|dd� | j p"| j| _| j}|jp6tj}t| jpB|�| _| � d�}t
| j�|_ | jrn| j|_n|j| _| jr�| j|_n|j| _|�
� || _t�|�� �}t�|�� �}|� d|� �| _tj�| j| j� d��| _d S )NzA--egg-base is deprecated for dist_info command. Use --output-dir.)i� � � )Zdue_date�egg_info�-z
.dist-info)r r �emitr �distributionZsrc_root�os�curdirr �reinitialize_command�strr r �finalize_optionsr r Z
safer_name�get_nameZsafer_best_effort_version�get_versionr �path�joinr )r �msg�distZproject_dirr r �versionr r r r$ 2 s*
zdist_info.finalize_options)�dir_path�requires_bkpc
c s\ |rR|� d�}t |dd� t||ddd� z
d V W d t |dd� t�||� X nd V d S )Nz.__bkp__T)�
ignore_errors)�
dirs_exist_ok�symlinks)�_rm�_copy�shutil�move)r r, r- Zbkp_namer r r �_maybe_bkp_dirS s
zdist_info._maybe_bkp_dirc C s� | j jddd� | j�� | jj}tj�|�s6td��t� d�
tj�| j��� | �
d�}| �|| j�� |�|| j� W d Q R X d S )NT)�parents�exist_okz&.egg-info dir should have been createdz
creating '{}'�bdist_wheel)r �mkdirr �runr r'