diff --git a/changelog.d/2870.breaking.rst b/changelog.d/2870.breaking.rst new file mode 100644 index 0000000000..1d17ede602 --- /dev/null +++ b/changelog.d/2870.breaking.rst @@ -0,0 +1 @@ +Started failing on invalid inline description with line breaks :class:`ValueError` -- by :user:`webknjaz` diff --git a/setuptools/dist.py b/setuptools/dist.py index 8e2111a52b..848d6b0f75 100644 --- a/setuptools/dist.py +++ b/setuptools/dist.py @@ -145,11 +145,11 @@ def read_pkg_file(self, file): def single_line(val): - # quick and dirty validation for description pypa/setuptools#1390 + """Validate that the value does not have line breaks.""" + # Ref: https://github.com/pypa/setuptools/issues/1390 if '\n' in val: - # TODO after 2021-07-31: Replace with `raise ValueError("newlines not allowed")` - warnings.warn("newlines not allowed and will break in the future") - val = val.replace('\n', ' ') + raise ValueError('Newlines are not allowed') + return val