o nh@sUdZddlmZddlZddlZddlmZddlmZddl m Z ddl m Z e r1ddl mZeeeefZd ed <d Zd d d ZGdddeZGdddeZGdddeZddZdS)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. ) annotationsN)date)cleandoc)indent) TYPE_CHECKING) TypeAliasr_DueDatez zP********************************************************************************z {details} c@sBeZdZdZe      ddddZe   ddddZdS)SetuptoolsWarningz/Base class in ``setuptools`` warning hierarchy.Nsummary str | Nonedetailsdue_date_DueDate | Nonesee_docssee_url stacklevelintreturnNonecKs|p t|ddp d}|pt|ddpd} |pt|dd}|p#t|dd} | o*d| } |p2t|dd}|r9t|nd} ||| | |pC| |} | rU| tkrUtrU|| tj| ||d d dS) 6Private: reserved for ``setuptools`` internal use only_SUMMARYN_DETAILS _DUE_DATE _SEE_DOCSz%https://setuptools.pypa.io/en/latest/_SEE_URL)r)getattrr_formattoday_should_enforcewarningswarn)clsr r rrrrkwargssummary_details_docs_refdocs_urlduetextr,V/opt/prometheus-monitoring-scripts/lib/python3.10/site-packages/setuptools/warnings.pyemits zSetuptoolsWarning.emitstr date | None format_args dict | Nonec Cst}t||p i}t||pi|r"||kr"d|ddnd|r+||kr+dnd|r4d|dndg}dd |D}|rUttjd |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|qSr,r,).0xr,r,r- Rsz-SetuptoolsWarning._format.. )r z!! z !!) rr r format_mapr _TEMPLATEformatjoin_INDENT) r$r r rrr1r possible_partspartsbodyr,r,r-r6s( zSetuptoolsWarning._format)NNNNNr )r r r r rrrr rr rrrr)NNN) r r/r r/rr0rr r1r2rr/)__name__ __module__ __qualname____doc__ classmethodr.rr,r,r,r-r sr c@eZdZdZdS)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@rArBr,r,r,r-rEYrEc@rD)SetuptoolsDeprecationWarningz Base class for warning deprecations in ``setuptools`` This class is not derived from ``DeprecationWarning``, and as such is visible by default. NrFr,r,r,r-rHcrGrHcCstdd}|dvS)NSETUPTOOLS_ENFORCE_DEPRECATIONfalse)trueonok1)osgetenvlower)enforcer,r,r-r!lsr!)rB __future__rrOr"datetimerinspectrtextwraprtypingrtyping_extensionsrtuplerr__annotations__r;r8 UserWarningr rErHr!r,r,r,r-s"      @