From 5758e4f9364f54327a4c602fbdd06b1cc6cca09c Mon Sep 17 00:00:00 2001 From: Brian Rutledge Date: Sat, 22 Jan 2022 12:19:28 -0500 Subject: [PATCH] Tweak message --- tests/test_package.py | 3 +-- twine/package.py | 8 ++++---- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/tests/test_package.py b/tests/test_package.py index 5eb0473d..3d2e2799 100644 --- a/tests/test_package.py +++ b/tests/test_package.py @@ -374,8 +374,7 @@ def test_pkginfo_returns_no_metadata(read_data, missing_fields, monkeypatch): package_file.PackageFile.from_filename(filename, comment=None) assert ( - f"Distribution metadata is missing required fields: {missing_fields}." - in err.value.args[0] + f"Metadata is missing required fields: {missing_fields}." in err.value.args[0] ) assert "1.0, 1.1, 1.2, 2.0, 2.1, 2.2" in err.value.args[0] diff --git a/twine/package.py b/twine/package.py index cb8104db..0619ba6e 100644 --- a/twine/package.py +++ b/twine/package.py @@ -111,10 +111,10 @@ def from_filename(cls, filename: str, comment: Optional[str]) -> "PackageFile": if missing_fields: supported_metadata = list(pkginfo.distribution.HEADER_ATTRS) raise exceptions.InvalidDistribution( - "Distribution metadata is missing required fields: " - f"{', '.join(missing_fields)}. " - "Make sure that the distribution includes the files where those fields " - "are specified, and that you're using a supported Metadata-Version: " + "Metadata is missing required fields: " + f"{', '.join(missing_fields)}.\n" + "Make sure the distribution includes the files where those fields " + "are specified, and is using a supported Metadata-Version: " f"{', '.join(supported_metadata)}." )