-
Notifications
You must be signed in to change notification settings - Fork 964
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
PEP 639 followup #17105
Comments
|
The transition from raw metadata to the
So it would seem that something is wrong in our translation from |
Yeah the path is relative to the project root so Hatchling has the correct behavior indeed https://peps.python.org/pep-0639/#add-license-file-field |
Yeah, something's wrong in the way we are parsing this from the form: diff --git a/tests/unit/forklift/test_metadata.py b/tests/unit/forklift/test_metadata.py
index e9e7a8c81..92335d3ac 100644
--- a/tests/unit/forklift/test_metadata.py
+++ b/tests/unit/forklift/test_metadata.py
@@ -29,15 +29,26 @@ def _assert_invalid_metadata(exc, field):
class TestParse:
def test_valid_from_file(self):
- meta = metadata.parse(b"Metadata-Version: 2.1\nName: foo\nVersion: 1.0\n")
+ meta = metadata.parse(
+ b"Metadata-Version: 2.4\nName: foo\nVersion: 1.0\nLicense-File: Something\nLicense-File: Something Else"
+ )
assert meta.name == "foo"
assert meta.version == Version("1.0")
+ assert meta.license_files == [
+ "Something",
+ "Something Else",
+ ]
def test_valid_from_form(self):
- data = MultiDict(metadata_version="2.1", name="spam", version="2.0")
+ data = MultiDict(metadata_version="2.4", name="spam", version="2.0")
+ data.extend([("license_file", "Something"), ("license_file", "Something Else")])
meta = metadata.parse(None, form_data=data)
assert meta.name == "spam"
assert meta.version == Version("2.0")
+ assert meta.license_files == [
+ "Something",
+ "Something Else",
+ ]
def test_invalid_no_data(self):
with pytest.raises(metadata.NoMetadataError): Results in:
|
I think we need to add a special case here: warehouse/warehouse/forklift/metadata.py Lines 277 to 334 in 3a3e946
|
Yeah, so looks like hatch is doing the right thing @ofek, I was just easily confused by the pluralization stuff... which is pretty inconsistent on both sides of specifications 😮💨 |
I noted that the first upload using Metadata 2.4/PEP 639 came in a few hours ago for retry-toolkit at https://pypi.org/project/retry-toolkit/0.6.1/.
Inspecting the result,
License-Expression
was successfully stored, but handling ofLicense-File
metadata appears to have been mishandled.Metadata for sdist:
and whl:
On closer inspection, I see that it was uploaded using pypa/hatch (which, sidenote, sends a generic httpx user-agent)...
Publishing locally to my dev environment I see that the post body has the key
license_file
:pypa/packaging and our implementation talk in
license_files
.CCing in @ofek @pradyunsg and @brettcannon for input on what the "correct" POST key should be.
The text was updated successfully, but these errors were encountered: