Skip to content

Commit

Permalink
Improve warning message for _WouldIgnoreField
Browse files Browse the repository at this point in the history
  • Loading branch information
abravalheri committed May 18, 2022
1 parent 89173d2 commit 97b4f2d
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions setuptools/config/_apply_pyprojecttoml.py
Original file line number Diff line number Diff line change
Expand Up @@ -341,7 +341,10 @@ def _acessor(obj):


class _WouldIgnoreField(UserWarning):
"""Inform users that ``pyproject.toml`` would overwrite previously defined metadata:
"""Inform users that ``pyproject.toml`` would overwrite previous metadata."""

MESSAGE = """\
{field!r} defined outside of `pyproject.toml` would be ignored.
!!\n\n
##########################################################################
# configuration would be ignored/result in error due to `pyproject.toml` #
Expand Down Expand Up @@ -369,5 +372,4 @@ class _WouldIgnoreField(UserWarning):
@classmethod
def message(cls, field, value):
from inspect import cleandoc
msg = "\n".join(cls.__doc__.splitlines()[1:])
return cleandoc(msg.format(field=field, value=value))
return cleandoc(cls.MESSAGE.format(field=field, value=value))

0 comments on commit 97b4f2d

Please sign in to comment.