diff --git a/fix-sdist-target.patch b/fix-sdist-target.patch new file mode 100644 index 0000000..47bee7e --- /dev/null +++ b/fix-sdist-target.patch @@ -0,0 +1,40 @@ +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() diff --git a/python-hatch.changes b/python-hatch.changes index 0f532e9..cc3fd4e 100644 --- a/python-hatch.changes +++ b/python-hatch.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Wed May 10 16:07:25 UTC 2023 - Daniel Garcia + +- Add fix-sdist-target.patch to fix tests: gh#pypa/hatch@1b10663e645e + ------------------------------------------------------------------- Fri May 5 10:45:53 UTC 2023 - Dirk Müller diff --git a/python-hatch.spec b/python-hatch.spec index 575ddce..7ba33fb 100644 --- a/python-hatch.spec +++ b/python-hatch.spec @@ -33,6 +33,8 @@ License: MIT URL: https://hatch.pypa.io/latest/ # SourceRepository: https://github.com/pypa/hatch Source: https://github.com/pypa/hatch/archive/refs/tags/hatch-v%{version}.tar.gz +# PATCH-FIX-UPSTREAM fix-sdist-target.patch -- gh#pypa/hatch@1b10663e645e +Patch0: fix-sdist-target.patch BuildRequires: %{python_module base >= 3.7} BuildRequires: %{python_module hatchling >= 1.14} BuildRequires: %{python_module pip}