Skip to content

Commit

Permalink
Rename base_metadata → pkg_info_metadata
Browse files Browse the repository at this point in the history
  • Loading branch information
maresb committed Dec 27, 2024
1 parent ba4e619 commit 02304b6
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions backend/src/hatchling/metadata/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,11 +86,12 @@ def core_raw_metadata(self) -> dict[str, Any]:
with open(pkg_info, encoding='utf-8') as f:
pkg_info_contents = f.read()

base_metadata = project_metadata_from_core_metadata(pkg_info_contents)
# Give `PKG-INFO` first priority to set the values of dynamic metadata
pkg_info_metadata = project_metadata_from_core_metadata(pkg_info_contents)
defined_dynamic = core_raw_metadata.get('dynamic', [])
for field in list(defined_dynamic):
if field in PROJECT_CORE_METADATA_FIELDS and field in base_metadata:
core_raw_metadata[field] = base_metadata[field]
if field in PROJECT_CORE_METADATA_FIELDS and field in pkg_info_metadata:
core_raw_metadata[field] = pkg_info_metadata[field]
defined_dynamic.remove(field)

return core_raw_metadata
Expand Down

0 comments on commit 02304b6

Please sign in to comment.