File: //usr/local/lib/python3.7/site-packages/setuptools/__pycache__/warnings.cpython-37.pyc
B
N��gP � @ s� d Z ddlZddlZddlmZ ddlmZ ddlmZ ddl m
Z
mZ eeeef Z
dZd� d d� �ZG d
d� de�ZG dd
� d
e�ZG dd� de�Zdd� ZdS )z�Provide basic warnings used by setuptools modules.
Using custom classes (other than ``UserWarning``) allow users to set
``PYTHONWARNINGS`` filters to run tests and prepare for upcoming changes in
setuptools.
� N)�date)�cleandoc)�indent)�Optional�Tuplez zP********************************************************************************z
{details}
c @ sj e Zd ZdZed
ee ee ee ee ee ed�dd��Z edeeee
ee ee d�dd ��ZdS )�SetuptoolsWarningz/Base class in ``setuptools`` warning hierarchy.N� )�summary�details�due_date�see_docs�see_url�
stacklevelc K s� |pt | dd�pd}|p&t | dd�p&d} |p6t | dd�}|pFt | dd�}
|
oTd|
� �}|pdt | dd�}|rrt|� nd}| �|| ||p�||�}
|r�|t�� k r�t� r�| |
��tj|
| |d d
� dS )z6Private: reserved for ``setuptools`` internal use onlyZ_SUMMARYN� Z_DETAILSZ _DUE_DATEZ _SEE_DOCSz%https://setuptools.pypa.io/en/latest/Z_SEE_URL� )r )�getattrr �_format�today�_should_enforce�warnings�warn)�clsr r
r r r
r �kwargsZsummary_Zdetails_Zdocs_refZdocs_urlZdue�text� r �7/tmp/pip-unpacked-wheel-yrlplx0q/setuptools/warnings.py�emit s
zSetuptoolsWarning.emit)r r
r r
�format_argsc
C s� t �� }t|��|pi �}t|��|p(i �|rD||krDd|d�d�nd|rV||k rVdnd|rhd|� d�ndg}dd � |D �}|r�ttjd
�|�d�t�} d
�|d| d
g�S |S )z6Private: reserved for ``setuptools`` internal use onlyz
By z%Y-%b-%dzi, you need to update your project and remove deprecated calls
or your builds will no longer be supported.Nzy
This deprecation is overdue, please update your project and remove deprecated
calls to avoid build errors in the future.z
See z
for details.c S s g | ]}|r|�qS r r )�.0�xr r r �
<listcomp>L s z-SetuptoolsWarning._format.<locals>.<listcomp>�
)r
z!!
z
!!) r r r �
format_mapr � _TEMPLATE�format�join�_INDENT)
r r r
r r
r r Zpossible_parts�parts�bodyr r r r 1 s
zSetuptoolsWarning._format)NNNNNr )NNN)
�__name__�
__module__�__qualname__�__doc__�classmethodr �str�_DueDate�intr r �dictr r r r r r s 0 r c @ s e Zd ZdZdS )�InformationOnlya Currently there is no clear way of displaying messages to the users
that use the setuptools backend directly via ``pip``.
The only thing that might work is a warning, although it is not the
most appropriate tool for the job...
See pypa/packaging-problems#558.
N)r) r* r+ r, r r r r r2 S s r2 c @ s e Zd ZdZdS )�SetuptoolsDeprecationWarningz�
Base class for warning deprecations in ``setuptools``
This class is not derived from ``DeprecationWarning``, and as such is
visible by default.
N)r) r* r+ r, r r r r r3 ] s r3 c C s t �dd��� } | dkS )NZSETUPTOOLS_ENFORCE_DEPRECATION�false)�true�on�ok�1)�os�getenv�lower)Zenforcer r r r f s r )r, r9 r �datetimer �inspectr �textwrapr �typingr r r0 r/ r&