diff options
| author | Jason R. Coombs <jaraco@jaraco.com> | 2021-11-12 19:01:55 -0500 |
|---|---|---|
| committer | Jason R. Coombs <jaraco@jaraco.com> | 2021-11-12 19:01:55 -0500 |
| commit | a4b7caeaa653116b60a5231e9019ab250293c331 (patch) | |
| tree | bb4ac78af304c4ddc40da7e0efde3b11d3e7af8e | |
| parent | 65d66538b937b083b276ed7058a779ccfa3c44d8 (diff) | |
| download | python-setuptools-git-a4b7caeaa653116b60a5231e9019ab250293c331.tar.gz | |
Restore single_line as a simple, universal validator.
| -rw-r--r-- | setuptools/dist.py | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/setuptools/dist.py b/setuptools/dist.py index e61733d8..848d6b0f 100644 --- a/setuptools/dist.py +++ b/setuptools/dist.py @@ -144,13 +144,11 @@ def read_pkg_file(self, file): self.license_files = _read_list_from_msg(msg, 'license-file') -def ensure_summary_single_line(val): - """Validate that the summary does not have line breaks.""" +def single_line(val): + """Validate that the value does not have line breaks.""" # Ref: https://github.com/pypa/setuptools/issues/1390 if '\n' in val: - raise ValueError( - 'Newlines in the package distribution summary are not allowed', - ) + raise ValueError('Newlines are not allowed') return val @@ -166,7 +164,7 @@ def write_pkg_file(self, file): # noqa: C901 # is too complex (14) # FIXME write_field('Metadata-Version', str(version)) write_field('Name', self.get_name()) write_field('Version', self.get_version()) - write_field('Summary', ensure_summary_single_line(self.get_description())) + write_field('Summary', single_line(self.get_description())) write_field('Home-page', self.get_url()) optional_fields = ( |
