From 6ce7fa9c674afc63b42f770a13679996295eea8c011ca37ad62d7d0a797a2eee Mon Sep 17 00:00:00 2001 From: Daniel Garcia Date: Thu, 26 Jun 2025 09:39:19 +0000 Subject: [PATCH] - Add click-8.2.patch to fix tests with click >= 8.2 gh#pypa/hatch#2013 OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-hatch?expand=0&rev=46 --- click-8.2.patch | 29 +++++++++++++++++++++++++++++ python-hatch.changes | 6 ++++++ python-hatch.spec | 6 +++++- 3 files changed, 40 insertions(+), 1 deletion(-) create mode 100644 click-8.2.patch diff --git a/click-8.2.patch b/click-8.2.patch new file mode 100644 index 0000000..a1b28b8 --- /dev/null +++ b/click-8.2.patch @@ -0,0 +1,29 @@ +From df295583784427214324b974c75901da12931ec1 Mon Sep 17 00:00:00 2001 +From: Daniel Garcia Moreno +Date: Thu, 26 Jun 2025 11:32:54 +0200 +Subject: [PATCH] Fix test_self with click >= 8.2.0 + +https://click.palletsprojects.com/en/stable/changes/#version-8-2-0 +--- + tests/cli/self/test_self.py | 8 +++++++- + 1 file changed, 7 insertions(+), 1 deletion(-) + +diff --git a/tests/cli/self/test_self.py b/tests/cli/self/test_self.py +index cd1a4aed1..f727b87f4 100644 +--- a/tests/cli/self/test_self.py ++++ b/tests/cli/self/test_self.py +@@ -1,7 +1,13 @@ + import os ++import importlib + + + def test(hatch): + result = hatch(os.environ['PYAPP_COMMAND_NAME']) ++ exit_code = 2 + +- assert result.exit_code == 0, result.output ++ click_version = importlib.metadata.version('click') ++ if click_version <= '8.1.8': ++ exit_code = 0 ++ ++ assert result.exit_code == exit_code, result.output diff --git a/python-hatch.changes b/python-hatch.changes index 6c44a8c..8844d93 100644 --- a/python-hatch.changes +++ b/python-hatch.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Thu Jun 26 09:36:32 UTC 2025 - Daniel Garcia + +- Add click-8.2.patch to fix tests with click >= 8.2 + gh#pypa/hatch#2013 + ------------------------------------------------------------------- Wed Apr 16 07:11:55 UTC 2025 - John Paul Adrian Glaubitz diff --git a/python-hatch.spec b/python-hatch.spec index be883b4..ecaf9e7 100644 --- a/python-hatch.spec +++ b/python-hatch.spec @@ -35,6 +35,8 @@ URL: https://hatch.pypa.io/latest/ Source: https://github.com/pypa/hatch/archive/refs/tags/hatch-v%{version}.tar.gz # PATCH-FIX-UPSTREAM fix-with-latest-hatchling.patch gh#f8a2eaa gh#28f233c gh#fc25690 Patch0: fix-with-latest-hatchling.patch +# PATCH-FIX-UPSTREAM click-8.2.patch gh#pypa/hatch#2013 +Patch1: click-8.2.patch BuildRequires: %{python_module base >= 3.8} BuildRequires: %{python_module hatch-vcs >= 0.3} BuildRequires: %{python_module hatchling >= 1.26.3} @@ -128,7 +130,9 @@ donttest+=" or test_uv_env" donttest+=" or test_pyenv or test_no_open or test_open" # Fails with hatchling >= 1.26 -%pytest -v -k "not ($donttest)" +# Ignore test_build.py it fails because output format difference. +# https://github.com/pypa/hatch/commit/e843c42da2e71468b519a3aacdfeab31b14985a3 +%pytest -v -k "not ($donttest)" --ignore tests/cli/build/test_build.py %endif %post