diff --git a/python-hunter.changes b/python-hunter.changes index 9f714f4..baa5f09 100644 --- a/python-hunter.changes +++ b/python-hunter.changes @@ -1,3 +1,10 @@ +------------------------------------------------------------------- +Fri Jul 4 01:51:20 UTC 2025 - Steve Kowalik + +- Switch to pyproject macros. +- Actually run the testsuite. +- No more greedy globs in %files. + ------------------------------------------------------------------- Sun Jun 30 19:18:44 UTC 2024 - Dirk Müller diff --git a/python-hunter.spec b/python-hunter.spec index 777495e..b05f547 100644 --- a/python-hunter.spec +++ b/python-hunter.spec @@ -1,7 +1,7 @@ # # spec file for package python-hunter # -# Copyright (c) 2024 SUSE LLC +# Copyright (c) 2025 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -23,8 +23,22 @@ Summary: Pytest plugin for coverage reporting License: BSD-2-Clause URL: https://github.com/ionelmc/python-hunter Source: https://files.pythonhosted.org/packages/source/h/hunter/hunter-%{version}.tar.gz +# PATCH-FIX-OPENSUSE Fix the testsuite to build with Python 3.13 +Patch0: support-python-313.patch +# PATCH-FIX-UPSTREAM gh#ionelmc/python-hunter#126 +Patch1: use-sys.executable.patch +BuildRequires: %pythons BuildRequires: %{python_module Cython} +BuildRequires: %{python_module aspectlib} +BuildRequires: %{python_module pip} +BuildRequires: %{python_module process-tests} +BuildRequires: %{python_module pytest-benchmark} +BuildRequires: %{python_module pytest} +BuildRequires: %{python_module py} BuildRequires: %{python_module setuptools_scm} +BuildRequires: %{python_module six} +BuildRequires: %{python_module tzdata} +BuildRequires: %{python_module wheel} BuildRequires: fdupes BuildRequires: python-rpm-macros Requires(post): update-alternatives @@ -37,16 +51,37 @@ but for debugging, logging, inspection and other nefarious purposes. %prep %autosetup -p1 -n hunter-%{version} +cat >src/build_tests.py <= 0x030B00A7 ++ #define Py_BUILD_CORE + #include "internal/pycore_frame.h" + #endif + """ diff --git a/use-sys.executable.patch b/use-sys.executable.patch new file mode 100644 index 0000000..44873b9 --- /dev/null +++ b/use-sys.executable.patch @@ -0,0 +1,52 @@ +From 5c1c453e19fce6cc1486db4e63a120d2646af97d Mon Sep 17 00:00:00 2001 +From: Steve Kowalik +Date: Fri, 4 Jul 2025 11:45:12 +1000 +Subject: [PATCH] Use sys.executable everywhere in test_remote + +Not all systems use python to run the interpreter, and this also doesn't +help if the user has multiple interpreters in their path. Use +sys.executable like the other test case in this file. +--- + tests/test_remote.py | 8 ++++---- + 1 file changed, 4 insertions(+), 4 deletions(-) + +diff --git a/tests/test_remote.py b/tests/test_remote.py +index 6574cc8..76e2869 100644 +--- a/tests/test_remote.py ++++ b/tests/test_remote.py +@@ -15,7 +15,7 @@ + + @pytest.mark.skipif('platform.system() == "Windows"') + def test_manhole(): +- with TestProcess('python', '-msamplemanhole') as target, dump_on_error(target.read): ++ with TestProcess(sys.executable, '-msamplemanhole') as target, dump_on_error(target.read): + wait_for_strings(target.read, TIMEOUT, 'Oneshot activation is done by signal') + + with TestProcess('hunter-trace', '-p', str(target.proc.pid), 'stdlib=False') as tracer, dump_on_error(tracer.read): +@@ -32,7 +32,7 @@ def test_manhole(): + + @pytest.mark.skipif('platform.system() == "Windows"') + def test_manhole_reattach(): +- with TestProcess('python', '-msamplemanhole') as target, dump_on_error(target.read): ++ with TestProcess(sys.executable, '-msamplemanhole') as target, dump_on_error(target.read): + wait_for_strings(target.read, TIMEOUT, 'Oneshot activation is done by signal') + + with TestProcess('hunter-trace', '-p', str(target.proc.pid), 'stdlib=False') as tracer, dump_on_error(tracer.read): +@@ -61,7 +61,7 @@ def test_manhole_reattach(): + + @pytest.mark.skipif('platform.system() == "Windows"') + def test_manhole_clean_exit(): +- with TestProcess('python', '-msamplemanhole') as target, dump_on_error(target.read): ++ with TestProcess(sys.executable, '-msamplemanhole') as target, dump_on_error(target.read): + wait_for_strings(target.read, TIMEOUT, 'Oneshot activation is done by signal') + + with TestProcess('hunter-trace', '-p', str(target.proc.pid), 'stdlib=False') as tracer, dump_on_error(tracer.read): +@@ -90,7 +90,7 @@ def test_manhole_clean_exit(): + @pytest.mark.skipif('platform.python_implementation() == "PyPy"') + @pytest.mark.skipif('not which("gdb")') + def test_gdb(): +- with TestProcess('python', '-msamplemanhole') as target, dump_on_error(target.read): ++ with TestProcess(sys.executable, '-msamplemanhole') as target, dump_on_error(target.read): + with TestProcess('hunter-trace', '-p', str(target.proc.pid), '--gdb', 'stdlib=False') as tracer, dump_on_error(tracer.read): + wait_for_strings( + tracer.read,