diff options
author | Jason R. Coombs <jaraco@jaraco.com> | 2021-11-12 19:03:46 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-11-12 19:03:46 -0500 |
commit | 77678abf97b4a8ee5e6e67b14cb21f543cd6bfd9 (patch) | |
tree | 3ed3239ce5c2171e2d92b7ed3dfca4d276072ca2 | |
parent | f2de34767a7ba6dc79b73e474b3e2ffdbfd6e75b (diff) | |
parent | 25d1d5458716f9f80b2c5094461579cfa0fe4469 (diff) | |
download | python-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.rst | 1 | ||||
-rw-r--r-- | setuptools/dist.py | 8 |
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 |