From 3594b54ee9dfea8353cc40391a72d008427c0b0677e10b4e13479ac092ae97c3 Mon Sep 17 00:00:00 2001 From: Steve Kowalik Date: Wed, 27 Mar 2024 03:00:48 +0000 Subject: [PATCH] - Add patch support-hatchling-1.22.patch: * Support updates for the new Hatchling. - Add missing BuildRequires on editables, required for tests. OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-hatch?expand=0&rev=33 --- python-hatch.changes | 7 +++++ python-hatch.spec | 5 ++++ support-hatchling-1.22.patch | 54 ++++++++++++++++++++++++++++++++++++ 3 files changed, 66 insertions(+) create mode 100644 support-hatchling-1.22.patch diff --git a/python-hatch.changes b/python-hatch.changes index 6d0870f..0e0cafa 100644 --- a/python-hatch.changes +++ b/python-hatch.changes @@ -1,3 +1,10 @@ +------------------------------------------------------------------- +Wed Mar 27 02:59:47 UTC 2024 - Steve Kowalik + +- Add patch support-hatchling-1.22.patch: + * Support updates for the new Hatchling. +- Add missing BuildRequires on editables, required for tests. + ------------------------------------------------------------------- Sun Mar 24 13:24:46 UTC 2024 - Dirk Müller diff --git a/python-hatch.spec b/python-hatch.spec index 45fd46b..37fc334 100644 --- a/python-hatch.spec +++ b/python-hatch.spec @@ -33,6 +33,10 @@ 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 Based on parts of the following commits: +# gh#pypa/hatch#9a80ffc2567bb09160e97f1ade1dd4c768004089 +# gh#pypa/hatch#f3b2159a8c4221062692881774bc58dfed5aaa76 +Patch0: support-hatchling-1.22.patch BuildRequires: %{python_module base >= 3.8} BuildRequires: %{python_module hatch-vcs >= 0.3} BuildRequires: %{python_module hatchling >= 1.19} @@ -58,6 +62,7 @@ Requires: python-zstandard < 1 Requires: (python-pexpect >= 4.8 with python-pexpect < 5) Requires: (python-userpath >= 1.7 with python-userpath < 2) %if %{with test} +BuildRequires: %{python_module editables} BuildRequires: %{python_module filelock >= 3.7.1} BuildRequires: %{python_module hatch = %{version}} BuildRequires: %{python_module pytest-mock} diff --git a/support-hatchling-1.22.patch b/support-hatchling-1.22.patch new file mode 100644 index 0000000..fa5a7c9 --- /dev/null +++ b/support-hatchling-1.22.patch @@ -0,0 +1,54 @@ +Index: hatch-hatch-v1.9.4/tests/backend/builders/test_wheel.py +=================================================================== +--- hatch-hatch-v1.9.4.orig/tests/backend/builders/test_wheel.py ++++ hatch-hatch-v1.9.4/tests/backend/builders/test_wheel.py +@@ -161,15 +161,18 @@ class TestDefaultFileSelection: + ValueError, + match=( + 'Unable to determine which files to ship inside the wheel using the following heuristics: ' +- 'https://hatch.pypa.io/latest/plugins/builder/wheel/#default-file-selection\n\nAt least one ' +- 'file selection option must be defined in the `tool.hatch.build.targets.wheel` table, see: ' +- 'https://hatch.pypa.io/latest/config/build/\n\nAs an example, if you intend to ship a ' +- 'directory named `foo` that resides within a `src` directory located at the root of your ' +- 'project, you can define the following:\n\n\\[tool.hatch.build.targets.wheel\\]\n' ++ 'https://hatch.pypa.io/latest/plugins/builder/wheel/#default-file-selection\n\n' ++ 'The most likely cause of this is that there is no directory that matches the name of your ' ++ 'project \\(my_app\\).\n\n' ++ 'At least one file selection option must be defined in the `tool.hatch.build.targets.wheel` ' ++ 'table, see: https://hatch.pypa.io/latest/config/build/\n\n' ++ 'As an example, if you intend to ship a directory named `foo` that resides within a `src` ' ++ 'directory located at the root of your project, you can define the following:\n\n' ++ '\\[tool.hatch.build.targets.wheel\\]\n' + 'packages = \\["src/foo"\\]' + ), + ): +- _ = method() ++ method() + + def test_bypass_selection_option(self, temp_dir): + config = { +Index: hatch-hatch-v1.9.4/tests/backend/builders/plugin/test_interface.py +=================================================================== +--- hatch-hatch-v1.9.4.orig/tests/backend/builders/plugin/test_interface.py ++++ hatch-hatch-v1.9.4/tests/backend/builders/plugin/test_interface.py +@@ -62,7 +62,7 @@ class TestMetadata: + config = {'project': {}} + builder = MockBuilder(str(isolation), config=config) + +- assert builder.project_config is builder.project_config is config['project'] ++ assert builder.project_config == builder.project_config == config['project'] + + def test_hatch(self, isolation): + config = {'tool': {'hatch': {}}} +Index: hatch-hatch-v1.9.4/tests/backend/metadata/test_core.py +=================================================================== +--- hatch-hatch-v1.9.4.orig/tests/backend/metadata/test_core.py ++++ hatch-hatch-v1.9.4/tests/backend/metadata/test_core.py +@@ -84,7 +84,6 @@ class TestDynamic: + dynamic = ['version'] + metadata = ProjectMetadata(str(isolation), None, {'project': {'dynamic': dynamic}}) + +- assert metadata.core.dynamic is dynamic + assert metadata.core.dynamic == ['version'] + + def test_cache_not_array(self, isolation):