Skip to content

Commit 7ed3e12

Browse files
committed
Slight fix
1 parent 5271279 commit 7ed3e12

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

backend/src/hatchling/metadata/core.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -84,16 +84,16 @@ def core_raw_metadata(self) -> dict[str, Any]:
8484
message = 'The `project` configuration must be a table'
8585
raise TypeError(message)
8686

87-
core_raw_metadata = deepcopy(core_raw_metadata)
8887
pkg_info = os.path.join(self.root, 'PKG-INFO')
8988
if os.path.isfile(pkg_info):
9089
from hatchling.metadata.spec import project_metadata_from_core_metadata
9190

9291
with open(pkg_info, encoding='utf-8') as f:
9392
pkg_info_contents = f.read()
9493

95-
base_metadata = project_metadata_from_core_metadata(pkg_info_contents)
96-
core_raw_metadata.update(base_metadata)
94+
core_raw_metadata = project_metadata_from_core_metadata(pkg_info_contents)
95+
else:
96+
core_raw_metadata = deepcopy(core_raw_metadata)
9797

9898
self._core_raw_metadata = core_raw_metadata
9999

tests/backend/metadata/test_core.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1684,7 +1684,7 @@ def test_dependencies(self, isolation, latest_spec):
16841684

16851685

16861686
def test_source_distribution_metadata(temp_dir, helpers, latest_spec):
1687-
metadata = ProjectMetadata(str(temp_dir), None, {'project': {}})
1687+
metadata = ProjectMetadata(str(temp_dir), None, {'project': {'dynamic': ['version']}})
16881688

16891689
pkg_info = temp_dir / 'PKG-INFO'
16901690
pkg_info.write_text(

0 commit comments

Comments
 (0)