Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions backend/src/hatchling/metadata/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -462,8 +462,7 @@ def description(self) -> str:
if not isinstance(description, str):
message = 'Field `project.description` must be a string'
raise TypeError(message)

self._description = description
self._description = ' '.join(description.splitlines())

return self._description

Expand Down
5 changes: 5 additions & 0 deletions tests/backend/metadata/test_core.py
Original file line number Diff line number Diff line change
Expand Up @@ -338,6 +338,11 @@ def test_custom(self, isolation):

assert metadata.core.description == metadata.core.description == 'foo'

def test_normaliza(self, isolation):
metadata = ProjectMetadata(str(isolation), None, {'project': {'description': '\nfirst line.\r\nsecond line'}})

assert metadata.core.description == metadata.core.description == ' first line. second line'


class TestReadme:
def test_dynamic(self, isolation):
Expand Down