Skip to content

Commit

Permalink
ensure new metadata 2.4 fields are sync'd to bq (pypi#17165)
Browse files Browse the repository at this point in the history
Co-authored-by: Dustin Ingram <di@users.noreply.github.com>
  • Loading branch information
ewdurbin and di authored Nov 25, 2024
1 parent fce17a5 commit 2763dad
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 3 deletions.
15 changes: 12 additions & 3 deletions tests/unit/forklift/test_legacy.py
Original file line number Diff line number Diff line change
Expand Up @@ -1195,17 +1195,24 @@ def test_successful_upload(

db_request.POST = MultiDict(
{
"metadata_version": "1.2",
"metadata_version": "2.4",
"name": project.name,
"version": release.version,
"filetype": "sdist",
"pyversion": "source",
"content": content,
"description": "an example description",
"keywords": "keyword1, keyword2",
"license_expression": "MIT OR Apache-2.0",
}
)
db_request.POST.extend([("classifiers", "Environment :: Other Environment")])
db_request.POST.extend(
[
("classifiers", "Environment :: Other Environment"),
("license_file", "LICENSE.APACHE"),
("license_file", "LICENSE.MIT"),
]
)
db_request.POST.update(digests)

@pretend.call_recorder
Expand Down Expand Up @@ -1289,7 +1296,7 @@ def storage_service_store(path, file_path, *, meta):
assert delay.calls == [
pretend.call(
{
"metadata_version": "1.2",
"metadata_version": "2.4",
"name": project.name,
"version": release.version,
"summary": None,
Expand All @@ -1300,6 +1307,8 @@ def storage_service_store(path, file_path, *, meta):
"maintainer": None,
"maintainer_email": None,
"license": None,
"license_expression": "MIT OR Apache-2.0",
"license_files": ["LICENSE.APACHE", "LICENSE.MIT"],
"keywords": ["keyword1", "keyword2"],
"classifiers": ["Environment :: Other Environment"],
"platform": None,
Expand Down
2 changes: 2 additions & 0 deletions warehouse/forklift/legacy.py
Original file line number Diff line number Diff line change
Expand Up @@ -1469,6 +1469,8 @@ def file_upload(request):
"maintainer": meta.maintainer,
"maintainer_email": meta.maintainer_email,
"license": meta.license,
"license_expression": meta.license_expression,
"license_files": meta.license_files,
"keywords": meta.keywords,
"classifiers": meta.classifiers,
"platform": meta.platforms[0] if meta.platforms else None,
Expand Down

0 comments on commit 2763dad

Please sign in to comment.