Skip to content

Commit 5758e4f

Browse files
committed
Tweak message
1 parent 4d3347f commit 5758e4f

File tree

2 files changed

+5
-6
lines changed

2 files changed

+5
-6
lines changed

tests/test_package.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -374,8 +374,7 @@ def test_pkginfo_returns_no_metadata(read_data, missing_fields, monkeypatch):
374374
package_file.PackageFile.from_filename(filename, comment=None)
375375

376376
assert (
377-
f"Distribution metadata is missing required fields: {missing_fields}."
378-
in err.value.args[0]
377+
f"Metadata is missing required fields: {missing_fields}." in err.value.args[0]
379378
)
380379
assert "1.0, 1.1, 1.2, 2.0, 2.1, 2.2" in err.value.args[0]
381380

twine/package.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -111,10 +111,10 @@ def from_filename(cls, filename: str, comment: Optional[str]) -> "PackageFile":
111111
if missing_fields:
112112
supported_metadata = list(pkginfo.distribution.HEADER_ATTRS)
113113
raise exceptions.InvalidDistribution(
114-
"Distribution metadata is missing required fields: "
115-
f"{', '.join(missing_fields)}. "
116-
"Make sure that the distribution includes the files where those fields "
117-
"are specified, and that you're using a supported Metadata-Version: "
114+
"Metadata is missing required fields: "
115+
f"{', '.join(missing_fields)}.\n"
116+
"Make sure the distribution includes the files where those fields "
117+
"are specified, and is using a supported Metadata-Version: "
118118
f"{', '.join(supported_metadata)}."
119119
)
120120

0 commit comments

Comments
 (0)