Index: hatch-hatch-v1.7.0/backend/src/hatchling/builders/sdist.py =================================================================== --- hatch-hatch-v1.7.0.orig/backend/src/hatchling/builders/sdist.py +++ hatch-hatch-v1.7.0/backend/src/hatchling/builders/sdist.py @@ -161,7 +161,7 @@ class SdistBuilder(BuilderInterface): def build_standard(self, directory: str, **build_data: Any) -> str: found_packages = set() - with SdistArchive(self.project_id, reproducible=self.config.reproducible) as archive: + with SdistArchive(self.artifact_project_id, reproducible=self.config.reproducible) as archive: for included_file in self.recurse_included_files(): if self.config.support_legacy: possible_package, file_name = os.path.split(included_file.relative_path) @@ -170,7 +170,9 @@ class SdistBuilder(BuilderInterface): tar_info = archive.gettarinfo( included_file.path, - arcname=normalize_archive_path(os.path.join(self.project_id, included_file.distribution_path)), + arcname=normalize_archive_path( + os.path.join(self.artifact_project_id, included_file.distribution_path) + ), ) if tar_info.isfile(): Index: hatch-hatch-v1.7.0/tests/backend/builders/test_sdist.py =================================================================== --- hatch-hatch-v1.7.0.orig/tests/backend/builders/test_sdist.py +++ hatch-hatch-v1.7.0/tests/backend/builders/test_sdist.py @@ -1516,9 +1516,9 @@ class TestBuildStandard: tar_archive.extractall(str(extraction_directory)) expected_files = helpers.get_template_files( - 'sdist.standard_default', project_name, relative_root=builder.project_id + 'sdist.standard_default', project_name, relative_root=builder.artifact_project_id ) helpers.assert_files(extraction_directory, expected_files) - stat = os.stat(str(extraction_directory / builder.project_id / 'PKG-INFO')) + stat = os.stat(str(extraction_directory / builder.artifact_project_id / 'PKG-INFO')) assert stat.st_mtime == get_reproducible_timestamp()