a oeq@sdZddlZddlZddlmZddlmZddlmZddl m Z m Z e e e e fZ dZdd dZGd d d eZGd d d eZGdddeZddZdS)zProvide 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)OptionalTuplez zP********************************************************************************z {details} c @sjeZdZdZed eeeeeeeeeeedddZ ed eeee eeee ddd Z dS) SetuptoolsWarningz/Base class in ``setuptools`` warning hierarchy.N)summarydetailsdue_datesee_docssee_url stacklevelcKs|pt|ddpd}|p&t|ddp&d} |p6t|dd}|pFt|dd} | oTd| } |pdt|dd}|rrt|nd} ||| | |p| |} | r| tkrtr|| tj| ||d d dS) 6Private: reserved for ``setuptools`` internal use onlyZ_SUMMARYNZ_DETAILSZ _DUE_DATEZ _SEE_DOCSz%https://setuptools.pypa.io/en/latest/Z_SEE_URL)r)getattrr_formattoday_should_enforcewarningswarn)clsr r r r r rkwargsZsummary_Zdetails_Zdocs_refZdocs_urlZduetextr4C:\Program Files\Certbot\pkgs\setuptools\warnings.pyemits zSetuptoolsWarning.emit)r r r r format_argsc Cst}t||pi}t||p(i|rD||krDd|ddnd|rV||krVdnd|rhd|dndg}dd |D}|rttjd |d t} d |d | d gS|S)rz 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.cSsg|] }|r|qSrr).0xrrr Mz-SetuptoolsWarning._format.. )r z!! z !!) rrr format_mapr _TEMPLATEformatjoin_INDENT) rr r r r rrZpossible_partspartsbodyrrrr1s( zSetuptoolsWarning._format)NNNNNr)NNN) __name__ __module__ __qualname____doc__ classmethodrstr_DueDateintrrdictrrrrrrs6rc@seZdZdZdS)InformationOnlyaCurrently 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. Nr+r,r-r.rrrrr4Tsr4c@seZdZdZdS)SetuptoolsDeprecationWarningz Base class for warning deprecations in ``setuptools`` This class is not derived from ``DeprecationWarning``, and as such is visible by default. Nr5rrrrr6^sr6cCstdd}|dvS)NZSETUPTOOLS_ENFORCE_DEPRECATIONZfalse)trueZonok1)osgetenvlower)Zenforcerrrrgsr)r.r:rZdatetimerinspectrtextwraprtypingrrr2r1r(r% UserWarningrr4r6rrrrrs   @