summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJason R. Coombs <jaraco@jaraco.com>2021-11-12 19:03:46 -0500
committerGitHub <noreply@github.com>2021-11-12 19:03:46 -0500
commit77678abf97b4a8ee5e6e67b14cb21f543cd6bfd9 (patch)
tree3ed3239ce5c2171e2d92b7ed3dfca4d276072ca2
parentf2de34767a7ba6dc79b73e474b3e2ffdbfd6e75b (diff)
parent25d1d5458716f9f80b2c5094461579cfa0fe4469 (diff)
downloadpython-setuptools-git-77678abf97b4a8ee5e6e67b14cb21f543cd6bfd9.tar.gz
Merge pull request #2870 from webknjaz/maintenance/fail-loudly-on-invalid-summary
Fail on a multiline distribution package summary
-rw-r--r--changelog.d/2870.breaking.rst1
-rw-r--r--setuptools/dist.py8
2 files changed, 5 insertions, 4 deletions
diff --git a/changelog.d/2870.breaking.rst b/changelog.d/2870.breaking.rst
new file mode 100644
index 00000000..1d17ede6
--- /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 8e2111a5..848d6b0f 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