- Add fix-sdist-target.patch to fix tests: gh#pypa/hatch@1b10663e645e

OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-hatch?expand=0&rev=17
This commit is contained in:
Daniel Garcia 2023-05-10 16:08:00 +00:00 committed by Git OBS Bridge
parent 244b96836e
commit d318249e4b
3 changed files with 47 additions and 0 deletions

40
fix-sdist-target.patch Normal file
View File

@ -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()

View File

@ -1,3 +1,8 @@
-------------------------------------------------------------------
Wed May 10 16:07:25 UTC 2023 - Daniel Garcia <daniel.garcia@suse.com>
- Add fix-sdist-target.patch to fix tests: gh#pypa/hatch@1b10663e645e
-------------------------------------------------------------------
Fri May 5 10:45:53 UTC 2023 - Dirk Müller <dmueller@suse.com>

View File

@ -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}